Is your export driver (apdtls.sys ? ) listed under the services key as a driver? Or does it just live under system32\drivers with no registry entries?
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@brandcomms.com
Sent: Wednesday, October 31, 2012 10:30 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] 64bit driver not loading after single line of code added
Thanks everyone for your suggestions. I still have the issue but can provide some feedback.
The dependency check shows just two dependencies which are found (NTOSKRNL and KSECDD)
I have used the checked Windows build with NTOSPNP Debug print filter tracing enabled but still no assertions or debug shown.
Then I found Doron’s excellent blog on debugging driver loading through MmLoadSystemImage breakpoints (http://blogs.msdn.com/b/doronh/archive/2006/03/13/550844.aspx). I found that MiDriverLoadSucceeded was called for my export driver, and MiLogFailedDriverLoad was called for the parent miniport driver. IopLoadDriver returned C0000199 (the specified image is already loaded as a dll)?
My current conclusions are that the miniport driver will not load if the export driver image size exceeds 0x40000 bytes. If I uncomment *any* code to reduce the image size >=0x40000 (even a mundane line of debug) the drivers will load. But if I add any line of code to bump the image size up a fraction to say 0x40080 then the miniport driver will not load.
What I did find from displaying the image headers is that the size of the stack reserve is 0x40000 bytes which coincidently is the maximum image size I am able to load!
The parent miniport driver is appas.sys and the export driver is apdtls.sys.
kd> !dh apdtls.sys
File Type: EXECUTABLE IMAGE
FILE HEADER VALUES
8664 machine (X64)
8 number of sections
50913D3F time date stamp Wed Oct 31 15:01:19 2012
0 file pointer to symbol table
0 number of symbols
F0 size of optional header
22 characteristics
Executable
App can handle >2gb addresses
OPTIONAL HEADER VALUES
20B magic #
9.00 linker version
31280 size of code
EA80 size of initialized data
0 size of uninitialized data
3F2E4 address of entry point
380 base of code
----- new -----
0000000000010000 image base
80 section alignment
80 file alignment
1 subsystem (Native)
6.01 operating system version
6.01 image version
6.01 subsystem version
40080 size of image
380 size of headers
44A90 checksum
0000000000040000 size of stack reserve
0000000000001000 size of stack commit
0000000000100000 size of heap reserve
0000000000001000 size of heap commit
When Drivers successfully load:
kd> !lmi apdtls.sys
Loaded Module Info: [apdtls.sys]
Module: APDTLS
Base Address: fffff88004dbf000
Image Name: APDTLS.SYS
Machine Type: 34404 (X64)
Time Stamp: 50913897 Wed Oct 31 14:41:27 2012
Size: 40000
CheckSum: 4b753
Characteristics: 22
Debug Data Dirs: Type Size VA Pointer
CODEVIEW 63, 38a5c, 38a5c RSDS - GUID: {0559C1B2-A157-4237-A026-784F3BEC4E65}
kd> lm t n
start end module name
fffff88004c12000 fffff880
04dbe900 APPAS APPAS.sys Wed Oct 31 09:33:59 2012 (5090F087)
fffff88004dbf000 fffff880
04dff000 APDTLS APDTLS.SYS Wed Oct 31 14:41:27 2012 (50913897)
When Drivers fail to load:
kd> !lmi apdtls.sys
Loaded Module Info: [apdtls.sys]
Module: APDTLS
Base Address: fffff88004c00000
Image Name: APDTLS.SYS
Machine Type: 34404 (X64)
Time Stamp: 50913a5d Wed Oct 31 14:49:01 2012
Size: 40080
CheckSum: 4aa24
Characteristics: 22
Debug Data Dirs: Type Size VA Pointer
CODEVIEW 63, 38adc, 38adc RSDS - GUID: {94A32B0D-F4E9-4FB1-B3B0-AFC692D08C0D}
kd> lm t n
start end module name
fffff88004c00000 fffff880
04c40080 APDTLS APDTLS.SYS Wed Oct 31 14:49:01 2012 (50913A5D)
Unloaded modules:
fffff88006632000 fffff880
067df000 APPAS.sys
Timestamp: unavailable (00000000)
Checksum: 00000000
ImageSize: 001AD000
fffff880027a4000 fffff880
027b8000 crashdmp.sys
Timestamp: unavailable (00000000)
Checksum: 00000000
ImageSize: 00014000
fffff880027b8000 fffff880
027c6000 dump_pciidex.sys
Timestamp: unavailable (00000000)
Checksum: 00000000
ImageSize: 0000E000
fffff880027c6000 fffff880
027d1000 dump_msahci.sys
Timestamp: unavailable (00000000)
Checksum: 00000000
ImageSize: 0000B000
fffff88004c51000 fffff880
04dfe000 APPAS.sys
Timestamp: unavailable (00000000)
Checksum: 00000000
ImageSize: 001AD000
Alan
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer