|
From: Brian H. <bh...@lu...> - 2007-09-05 07:51:37
|
Thanks Danny. Perhaps I didn't end up with the latest mingw distribution (but I think I did), or maybe i'm missing an include file, but, DRIVER_INITIALIZE is not in the winddk.h of the current mingw distribution (include files). And in the 6001 release of WinDDK DDKAPI does not appear in the definitions for these (in wdm.h). So, I took the approach of the libusb-win32-src project (which was referenced in another thread on this subject) and simply did NTSTATUS DDKAPI DriverEntry(........) (and added DDKAPI to the other functions as appropriate, and used the same flags they indicated they used for the build). I believe this should have the same effect as creating the typedef you indicated below, and declaring it that way. which eliminated the warning. And the exported symbols now has DriverEntry@8 (although oddly objdump for libusb project which also uses the -Wl,--entry,_DriverEntry@8, only has DriverEntry listed in the objdump -- and perhaps more strangely the native build of toaster.sys with the 6001 does not show any exported symbols). The warning is gone, but the system still crashes in the same manner with the same basic minidump information. I am guessing that this crash is happening either because it is never getting to DriverEntry which is setting up the pointers, or it is getting to DriverEntry and the pointers are somehow not what are expected when it attempts to call the AddDriver function. I will keep experimenting, but its difficult to know exactly what the kernel is unhappy about. I do appreciate the help, and hope to be able to post a final 'this is what I did and it works' if I ever do get it to work. -- Brian At 06:11 PM 9/4/2007, you wrote: > > I do get a warning about linking _DriverEntry@8 to > > _DriverEntry (and using > > --enable-stdcall-fixup or --disable-stdcall-fixup). Not sure > > if there is > > anything valuable in that warning. > > >Always. > >I belive that you should declare your DriverEntry routines as > >DRIVER_INITIALIZE DriverEntry; > >Do a google for typedef DRIVER_INITIALIZE. It has DDKAPI (=stdcall) >calling convention. > typedef NTSTATUS >(DDKAPI DRIVER_INITIALIZE)( > IN struct _DRIVER_OBJECT *DriverObject, > IN PUNICODE_STRING RegistryPath); >typedef DRIVER_INITIALIZE *PDRIVER_INITIALIZE; > >Danny > > > >------------------------------------------------------------------------- >This SF.net email is sponsored by: Splunk Inc. >Still grepping through log files to find problems? Stop. >Now Search log events and configuration files using AJAX and a browser. >Download your FREE copy of Splunk now >> http://get.splunk.com/ >_______________________________________________ >MinGW-users mailing list >Min...@li... > >You may change your MinGW Account Options or unsubscribe at: >https://lists.sourceforge.net/lists/listinfo/mingw-users |