| |
|
|
| What am I doing here wrong? (Windows2000/XP) CompileMarkSeparationDef @RtlInitUnicodeString(2) !"NTDLL","RtlInitAnsiString"
Def @RtlInitUnicodeString(2) !"NTDLL","RtlInitUnicodeString"
Def @RtlAnsiStringToUnicodeString(3) !"NTDLL","RtlAnsiStringToUnicodeString"
DEF @LsaNtStatusToWinError(1) !"advapi32","LsaNtStatusToWinError"
DEF @FormatMessage(7) !"KERNEL32","FormatMessageA"
Def @RtlInitAnsiString(2) !"NTDLL","RtlInitAnsiString"
Def @ZwOpenFile(6) !"NTDLL","ZwOpenFile"
Def @ZwClose(1) !"NTDLL","ZwClose"
Declare LSA_Unicode#,ANSI$,Unicode#,Fehler&,Ansi#
Declare AHRückgabe&,AHGETERROR_Buffer#,AHGETERROR_Buffer$
Declare FileHandle&,Status_Block&,Object_Attributes#
Windowstyle 31
WindowTitle "Datei auslesen mit Kernelmode APIs"
Window 0,0-640,440
LET ANSI$="??"+"F:EigenesMister RootUnload.CLL" Pfad bitte anpassen
Dim Ansi#,8
DIM Unicode#,514
DIM LSA_Unicode#,8
WORD LSA_Unicode#,0=0
WORD LSA_Unicode#,2=512
LONG LSA_Unicode#,4=UNICODE#
@RtlInitAnsiString(Ansi#,@ADDR(ANSI$))
LET Fehler&=@RtlAnsiStringToUnicodeString(LSA_Unicode#,Ansi#,0)
LET AHRÜCKGABE&=@LsaNtStatusToWinError(Fehler&)
Fehlercode_bestimmen
PRINT AHGETERROR_Buffer$
Print @Char$(UNICODE#,0,@LEN(ANSI$)*2)
DIM Object_Attributes#,24
Clear Object_Attributes#
Long Object_Attributes#,0=24
Long Object_Attributes#,4=0
Long Object_Attributes#,8=LSA_Unicode#
Long Object_Attributes#,12=$40
LET FEHLER&=@ZwOpenFile(@ADDR(FileHandle&),$110003,Object_Attributes#,@ADDR(Status_Block&),$1,$800 | $20 | $2 | $8)
LET AHRÜCKGABE&=@LsaNtStatusToWinError(Fehler&)
Fehlercode_bestimmen
PRINT "ZwOpenFile: "+AHGETERROR_Buffer$
LET FEHLER&=@ZwClose(FileHandle&)
LET AHRÜCKGABE&=@LsaNtStatusToWinError(Fehler&)
Fehlercode_bestimmen
PRINT "ZwClose: "+AHGETERROR_Buffer$
Dispose Unicode#
Dispose LSA_Unicode#
While 0=0
Waitinput
wend
End
Proc Fehlercode_bestimmen
DIM AHGETERROR_Buffer#,32000
@FormatMessage($1000,0,AHRückgabe&,0,AHGETERROR_Buffer#,32000,0) Wandelt Fehlercode in Landesspezifische Message um.
Let AHGETERROR_Buffer$=@trim$(@STRING$(AHGETERROR_Buffer#,0))
Dispose AHGETERROR_Buffer#
/../function-references/XProfan/endproc/'>Endproc
Greeting
Andreas |
|
|
| |
|
|
|
Michael Wodrich | ANSI$=??+F:EigenesMister RootUnload.CLLPfad Please adjust
2 or 3 question mark? CLL instead of DLL? |
|
|
| Programmieren, das spannendste Detektivspiel der Welt. | 10/27/06 ▲ |
|
|
|
|
| is only some Dateiname. the whole does nothing other as The OpenFile API, only does sies in Kernel. The Problems come into being by me at Closing the Mainwindow. |
|
|
| |
|
|
|
Michael Wodrich | and How should one guess what wrong is, if simply something inserted becomes?
P.s.: by me says it: The process watts successful exits. Then one Unicodestring displayed (the Dateiname). whom ought to one to the display transfiguring. |
|
|
| Programmieren, das spannendste Detektivspiel der Welt. | 10/28/06 ▲ |
|
|
|
|
| set there simply time irgeneinen (vorhandenen) Filenames with way one. The question mark must stay. Zürückgeliefert becomes in FileHandle& a handle on The File. |
|
|
| |
|
|
|
Michael Wodrich | everything supply zero back. is the one Error or should the success signalisieren???
ZwOpenFile but only ZwClose (without File)??? |
|
|
| Programmieren, das spannendste Detektivspiel der Welt. | 10/28/06 ▲ |
|
|
|
|
Michael Wodrich | [box:3dc1a1301e] ----------------------------------------------------- saturday, the 28. october 2006 - 00:52 ----------------------------------------------------- RtlAnsiStringToUnicodeString CODE:0 LsaNtStatusToWinError CODE:0 LsaNtStatusToWinError CODE:0 The process watts successful exits. ??C:CodeWodMisterRoot.prf ZwOpenFile CODE:0 ZwOpenFile HANDLE: $88 ZwOpenFile STATUS: $0 LsaNtStatusToWinError CODE:0 LsaNtStatusToWinError CODE:0 ZwOpenFile: The process watts successful exits. ZwClose CODE:0 LsaNtStatusToWinError CODE:0 LsaNtStatusToWinError CODE:0 ZwClose: The process watts successful exits. [/box:3dc1a1301e] |
|
|
| Programmieren, das spannendste Detektivspiel der Welt. | 10/28/06 ▲ |
|
|
|
|
Michael Wodrich | The a Error Code is always twice, because I Umlauten in the Variablennamen not traue - have means once Kleinschrift and once Großschrift at Variablennamen using.
fact is: The code runs through (with obigen informations) and then semmelt the program ex.
The both additional Dispose have I already with adopted, on it lying not.
I know unfortunately weder The detailed Aufrufparameter yet The in the structure expected values, can there means not help on.
Best wishes Michael Wodrich |
|
|
| Programmieren, das spannendste Detektivspiel der Welt. | 10/28/06 ▲ |
|
|
|
|
| by me schwirrt the code with Access violation ditto at Closing the Mainwindow ex - runs but otherwise everything without Problems through. windows bow or fallacy? The problem shining with ZwOpenFile To lying. ZwClose shining there too on the right Space To his - strange...
PS: 0=Erfolgsmeldung (NT_STATUS Codes).
be straight with whom Vorbereitungen for my driver. Have me decided, still over The Registry to go, this is anyhow rather. I schreib first time Kernelcode in Profan; whom I will then nacher in MASM umsetzen.
Wundere you not over The APIs - the are Native APIs - in the Kernel Gibts nothing other.
@IF: take off a driver want You write? Perhaps can itself replace... |
|
|
| |
|
|
|
| [quote:1695c7078e]@IF: take off a driver want You write? Perhaps can itself replace...[/quote:1695c7078e] I need something very simple - what but Perhaps very therefore not at all so simply To manage is.
a Druckertreiber - the not Druckt - separate The File the To druckenden Dokumentes on a place the network copies. |
|
|
| |
|
|
|
| Dakannst You some from the what here standing Perhaps already use. |
|
|
| |
|
|
|
Michael Wodrich | [quote:25b82596d4]a Druckertreiber - the not Druckt - separate The File the To druckenden Dokumentes on a place the network copies.[/quote:25b82596d4] it can itself but still eachone Druckertreiber so take on, the it in a File druckt. by me runs the since year and day so (have namely none printer).
tuned is a Laserdrucker (Postscript). The File then subsequently with a Tool (WordToPdf) in a PDF-File gewandelt.
from OpenOffice does it naturally plainer, but any others Applications produce on these manner too a PDF.
If I then really time a Print of it need GEHTS with the PDF ex To friends...
Best wishes Michael Wodrich
Have time quick nachgesehen: Canon C LBP 460PS |
|
|
| Programmieren, das spannendste Detektivspiel der Welt. | 10/28/06 ▲ |
|
|
|