Some linking error

Hi,

I am trying to use the IoGetConfigurationInformation dunction declared
in ntddk.h. here is the code, (I am using WinNT DDK)

#include <stdio.h>
#include
#include <ntddk.h>

int main(int argc, char* argv)
{

PCONFIGURATION_INFORMATION pcinfo =
IoGetConfigurationInformation();

return 0;

}

Now I am able to compile it on Windows NT, (I am specifying X86 flag
explicitely), but am not able to link it. It is giving some linker error
like this :

---------------
ScsiInfo.obj : error LNK2001: unresolved external symbol
“__declspec(dllimport) struct _CONFIGURATION_INFORMATION *__cdecl
IoGetConfigurationInformation(void)”
(_imp?IoGetConfigurationInformation@@YAPAU_CONFIGURATION_INFORMATION@@XZ)
Debug/ScsiInfo.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
---------------

I even tried finding in which library has this symbol, but even after
specifying that thing( d:\DDK\lib\i386\checked\NTOSKRNL.LIB ), I am not
able to link it.

Can somebody tell me what am I missing?

-Pankaj</ntddk.h></stdio.h>

The ddk, and ntddk.h (or wdm.h,) in particular define the kernel api.
You are attempting to link to the kernel api in a user mode program, and
that will not work. Instead use the platform SDK and the user mode
system apis defined there. There is, as far as I know, no equivalent to
the IoGetConfigurationInformation kernel API, but that information is
not useful in user mode.

===========================
Mark Roddy
Consultant, Microsoft DDK MVP
Hollis Technology Solutions
xxxxx@hollistech.com
www.hollistech.com
603-321-1032

-----Original Message-----
From: Pankaj
To: “NT Developers Interest List”
Date: Sat, 24 Aug 2002 16:51:26 +0530
Subject: [ntdev] Some linking error

> Hi,
>
> I am trying to use the IoGetConfigurationInformation dunction declared
> in ntddk.h. here is the code, (I am using WinNT DDK)
>
> #include <stdio.h>
> #include
> #include <ntddk.h>
>
> int main(int argc, char* argv)
> {
>
> PCONFIGURATION_INFORMATION pcinfo =
> IoGetConfigurationInformation();
>
> return 0;
>
> }
>
> Now I am able to compile it on Windows NT, (I am specifying X86 flag
> explicitely), but am not able to link it. It is giving some linker
> error
> like this :
>
> ---------------
> ScsiInfo.obj : error LNK2001: unresolved external symbol
> “__declspec(dllimport) struct _CONFIGURATION_INFORMATION *__cdecl
> IoGetConfigurationInformation(void)”
> (_imp?IoGetConfigurationInformation@@YAPAU_CONFIGURATION_INFORMATION@
> @XZ)
> Debug/ScsiInfo.exe : fatal error LNK1120: 1 unresolved externals
> Error executing link.exe.
> ---------------
>
> I even tried finding in which library has this symbol, but even after
> specifying that thing( d:\DDK\lib\i386\checked\NTOSKRNL.LIB ), I am not
> able to link it.
>
> Can somebody tell me what am I missing?
>
> -Pankaj
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@hollistech.com
> To unsubscribe send a blank email to %%email.unsub%%</ntddk.h></stdio.h>