I am using ZwQueryInformationFile to obtain the size of a binary file that contains firmware. Probl...
By anonymous
Usually, when I burn a DVD or CD, I select "Verify Written Data". I had to remove and reload Nero 6 ...
By alexethridge
Map N onto the expression or use a replacement ruleN[a]=2.;k=z*(a*Pi);{N[k],N/@k,k/.a->2.}...
By bob_hanlon
Dear Friend,Nagpur is a city in India which is located in the state ofMaharashtraand is home to near...
By rumki
I installed ZWiki by unpacking and putting the folder into my ZopeProducts directory. I restarted Zo...
By baiewola, 1 Comments
When i try opening Acer ePower Management on my laptop I get the message "the specified management c...
By blinky1988, 5 Comments
Hello,the Sin of a real number between zero and Pi should be positive, asSimplify finds out, too.In[...
By martin_schoenecker, 3 Comments
Hi, I'm trying to extract a full name from ZwCreateFile (called by the system). The documentati...
By anonymous, 3 Comments
Using 2003 Professional. When I select "Record Macro" and go thru the various steps I get and error ...
By anonymous, 2 Comments
NtLockVirtualMemory is not exported in kernel mode, you cannot link to it.
By specifying ntdll as your target lib, you are asking your driver to
resolve an import from ntdll.dll, not the kernel image. So yes, your driver
will never load. If you are looking to lock a particular page, check out
MmProbeAndLockPages. This will do exactly what you need. Make sure you
unlock before the process terminates though, or you will be the recipient of
bugcheck 0x76.
Hope that helps,
Carly
> I couldnt find the solution to this anywhere. I am writing a kernel
> mode driver that needs to lock a particular page of an user-mode
> process (since I dont have the source for this, I can't use API calls
> from within the user-space process) so that it doesn't get paged out.
> I am using ZwLockVirtualMemory on WinXP SP2 this way:
> ntStatus = ZwLockVirtualMemory((HANDLE)-1, &tmp_base, &tmp_size,
> LOCK_VM_IN_WSL | LOCK_VM_IN_RAM);
> and declared as:
> NTSYSAPI
> NTSTATUS
> NTAPI
> ZwLockVirtualMemory(
> IN HANDLE,
> IN OUT PVOID,
> IN OUT PULONG,
> IN ULONG);
> My SOURCES file is:
> TARGETNAME=mydriver
> TARGETPATH=BIN
> TARGETTYPE=DRIVER
> TARGETLIBS=$(DDK_LIB_PATH)\ntdll.lib
> SOURCES= driver.c
> Initially, I was getting linker unresolved symbol errors for the
> _ZwLockVirtualMemory symbol, so I had to add ntdll.lib to the
> TARGETLIBS variable. Then when I do a "build" (without any parameters),
> it doesn't complain at link time anymore.
> However, the driver doesnt even *load* if the ZwLockVirtualMemory
> function is compiled it. If I comment it out, and then load the driver
> with the rest of the symbols (including ones like
> ZwAllocateVirtualMemory etc), it loads just fine. The load fails at
> "StartServiceA()" call.. it returns with (from GetLastError):
> "ERROR_PROC_NOT_FOUND 127 The specified procedure could not be found."
> Could someone please let me know how to declare, define, compile, link,
> load ZwLockVirtualMemory() on WinXP SP2 so that I dont have this issue
> anymore?
> Thanks!
>
carl | Tues, 20 May 2008 07:43:00 GMT |