From: Arsalan Ahmad on 21 Feb 2007 05:36 It seems that my DriverEntry() function is not being called within context of Device.exe. Any ideas? Thanks, Arsalan "Arsalan Ahmad" <arsalan_ahmad(a)fornntp.com> wrote in message news:OhYR$zPVHHA.528(a)TK2MSFTNGP03.phx.gbl... > Hello all, > > As discussed in this thread, I did following: > > 1. Add necessary registry entries for my NDIS miniport driver. > 2. From my application I called NdisRegisterAdapter() which loads the > driver dll inside the device manager and calls its DriverEntry() function. > 3. Inside the DriverEntry() I initialized my miniport driver and create an > adapter object (pointed to by a global variable g_pAdapter) inside the > MiniportInitialize() function. > 4. Once the adapter object is created I called RegisterDevice() to load my > stream interface. > 5. My XXX_Init() function is called. > > However inside XXX_Init() function when I check the value of g_pAdapter, > which I previously allocated it is NULL. > > So it means that my driver is loaded twice which I do not want. How can I > just load a single driver with both the capabilities i.e. it should be a > miniport NDIS adapter with a stream interface? > > Thanks, > > Arsalan > > "Stephan Wolf [MVP]" <stewo68(a)hotmail.com> wrote in message > news:1171877623.318771.239770(a)l53g2000cwa.googlegroups.com... >> Ok, now I understand your concern. I actually did this years ago, >> i.e., register a stream interface for an NDIS miniport under CE (IIRC, >> that was CE 4.1): >> >> I call ActivateDevice() from MiniportInitialize() with a 'lpszDevKey' >> of "Comm\\MyDriverName" whwre "MyDriverName" is the base filename of >> the NDIS miniport driver. >> >> In the .DEF file, I add the stream interface functions to the EXPORTS >> section: >> >> MDN_Init >> MDN_Deinit >> MDN_Open >> MDN_Close >> MDN_Read >> MDN_Write >> MDN_Seek >> MDN_IOControl >> >> ..where "MDN" should be your stream driver prefix (here, MDN = "my >> driver name"). >> >> In the .REG file, I add: >> >> [HKEY_LOCAL_MACHINE\Comm\MyDriverName] >> "DisplayName"="My Driver" >> "Group"="NDIS" >> "ImagePath"="MyDriverName.dll" >> "Prefix"="MDN" >> "Dll"="MyDriverName.dll" >> >> Again, this was IIRC CE 4.1, so I am not sure if this still works >> exactly this way in today's CE. >> >> HTH, Stephan >> --- >> On Feb 15, 10:50 am, "Arsalan Ahmad" <arsalan_ah...(a)fornntp.com> >> wrote: >>> Hello all, >>> >>> I want to create an NDIS miniport driver with stream interface. Please >>> tell >>> me what should I do as discussed below? >>> >>> 1. Either I create a driver which exposes all DriverEntry(), XXX_Open(), >>> XXX_Close(), XXX_Read() etc functions. I initialize miniport in >>> DriverEntry() function. >>> >>> 2. Or I create a driver which exposes XXX_Init(), XXX_DeInit(), >>> XXX_Close(), >>> XXX_Open(), XXX_Read() functions (no DriverEntry() function) and I >>> initialize miniport in XXX_Init() function. >>> >>> Thanks, >>> >>> Arsalan >> >> >
From: "Remi de Gravelaine" gravelaine at aton dash sys dot on 22 Feb 2007 03:53 Put a breakpoint at the beginning of your DriverEntry function and look at the callstack, if you did not before: you will probably be able to figure out the call chain. If DriverEntry is called in the context of your process and if the driver works (does it really?), just consider accessing it like any other process DLL: the stream interface is a requirement only for the device manager. Remi
First
|
Prev
|
Pages: 1 2 3 Prev: How to use IOCTL_USB_USER_REQUEST Next: CreateFile and GetVolumeInformation fail |