Use coredll.lib in kernel



Dear all,

I am writing a dll driver, which will be loaded by the application into
kernel by using LoadKenrnelLibrary(). In this dll driver, I need to
access registry to get PCI bus address, translate it into virtual
address. This address actually corresponds to a register. After I get
this virtual address, I will use READ_REGISTER_UCHAR to read this
register.

1. This is a normal way if we code it in the user mode. However, it's
difficult in my case because I need to load this dll into kernel. If I
link my code with coredll.lib, I can compile and build it. But
LoadKernelLibrary() will fail.

2. I am using Windows CE 4.2. I heard that 6.0 will have kernel
coredll.lib version, which can be loaded into kernel. Can I do
something in 4.2 to also load kernel version coredll.lib?

3. I also heard that somebody used SC_LoadLibrary() in dll to load
coredll.lib, then use GetProcAddress() to access those functions. Does
4.2 have this function? Does it need some special library? I tried it,
but SC_LoadLibrary() gave me "unresolved external symbol" errors.

4. Also, some posts mentioned NKRegOpenKeyEx() can be used in kernel.
But it needs to link to nk.lib. I am building this dll in eMVC, not
platform builder. And I don't have intention to build this dll into the
image. So, if I want to use NKRegOpenKeyEx(), how can I link it to
nk.lib? It seems that I need lots of other libraries, such as hal.lib,
kitleth.lib etc. Even I linked several those libraries in my project, I
still got "unresolved external symbol" errors for some functions I
don't want to use. They are actually pointing to some functions in the
libraries I linked.

Can somebody give me a hint how to do this?

Thank you very much
Platman42

.



Relevant Pages

  • registering c# dll for Analysis services
    ... Im used to register vb6 dll's to enhence AS function libraries. ... I have a problem with the same procedure when dll is written in c#. ...
    (microsoft.public.sqlserver.olap)
  • Re: Install C# DLL for COM
    ... libraries for access by other .Net applications is done through the Global ... > a Visual Studio Setup project and register it for COM usage. ... > development of the library it was no problem to register the resulting dll ... But in the installation ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Have Admin Rights but getting PRJ0050 error
    ... I have an ATL DLL that is linked to 10 libraries. ... it links ok but I can't get the DLL to register. ... dependencies, other than msjava.dll. ...
    (microsoft.public.vc.atl)
  • Have Admin Rights but getting PRJ0050 error
    ... I have an ATL DLL that is linked to 10 libraries. ... it links ok but I can't get the DLL to register. ... dependencies, other than msjava.dll. ...
    (microsoft.public.vc.atl)
  • RE: Need help in exporting API for Kernel Mode DLL to Application
    ... You cannot call into a kernel DLL from a user application that way. ... you handle a custom IOCTL_MYTEST in MYD_IOControl and call DeviceIoControl ... When this MYDTest is called in application, ...
    (microsoft.public.windowsce.platbuilder)

Loading