Re: DDK console build problem?
  Home FAQ Contact Sign in
comp.os.mswindows.programmer.win32 only
 
Advanced search
POPULAR GROUPS

more...

 Up
Re: DDK console build problem?         

Group: comp.os.mswindows.programmer.win32 · Group Profile
Author: ssylee
Date: May 30, 2008 00:51

On May 28, 1:24 pm, Kevin gmail.com> wrote:
> Is there such a thing as a console windows driver?
>
> I copied the bindview example, and I was hoping to make a console
> project that
> did similar actions so I can feed command-line arguments to it.
>
> At any rate, I changed the sources file as follows:
> UMTYPE=windows => console
> UMENTRY=winmain => main
>
> I ripped out all of the source files but the one I want to make and
> just put:
> int __cdecl main(int argc, char* argv[])
> {
> int lnReturnValue = 0;
> printf("Hello world!\n");
>
> return (lnReturnValue);
>
> }
>
> Nothing happens, so I google, and find I need to do the following:
> #include
>
> NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING
> RegistryPath)
> {
> DbgPrint("Hello world\n");
>
> return STATUS_SUCCESS;
>
> }
>
> Which results in a cascade of errors:
> c:\winddk\3790.1830\inc\ddk\wxp\ntddk.h(2156) : error C2220: warning
> treated as
> error - no object file generated
> c:\winddk\3790.1830\inc\ddk\wxp\ntddk.h(2156) : error C4162:
> '_ReturnAddress' :
> no function with C linkage found
> c:\winddk\3790.1830\inc\ddk\wxp\ntddk.h(6902) : error C4162:
> '_InterlockedExchan
> ge' : no function with C linkage found
> c:\winddk\3790.1830\inc\ddk\wxp\ntddk.h(6928) : error C4162:
> '_InterlockedIncrem
> ent' : no function with C linkage found
> c:\winddk\3790.1830\inc\ddk\wxp\ntddk.h(6941) : error C4162:
> '_InterlockedDecrem
> ent' : no function with C linkage found
> c:\winddk\3790.1830\inc\ddk\wxp\ntddk.h(6955) : error C4162:
> '_InterlockedExchan
> geAdd' : no function with C linkage found
> c:\winddk\3790.1830\inc\ddk\wxp\ntddk.h(6985) : error C4162:
> '_InterlockedCompar
> eExchange' : no function with C linkage found
> c:\winddk\3790.1830\inc\ddk\wxp\ntddk.h(7037) : error C4162:
> '_InterlockedOr' :
> no function with C linkage found
> c:\winddk\3790.1830\inc\ddk\wxp\ntddk.h(7047) : error C4162:
> '_InterlockedAnd' :
> no function with C linkage found
> c:\winddk\3790.1830\inc\ddk\wxp\ntddk.h(7057) : error C4162:
> '_InterlockedXor' :
> no function with C linkage found
>
> I tried changing sources as follows:
> TARGETTYPE=PROGRAM => DRIVER
>
> But to no avail. What gives? Am I trying to do something completely
> wrong
> here? Please help a noob to the WIN32 driver world...
>
> Thanks,
>
> -Kevin

What are you trying to do with the driver anyway? There are just plain
old console applications.
no comments
diggit! del.icio.us! reddit!