Page Fault while loading DLLs in CE6.0!!
- From: Werner <Werner@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 17 Jan 2007 09:26:00 -0800
Hi,
I am having serious trouble working with DLLs under Windows CE 6.0. I wrote
a small EXE (exe6.exe) that loads a DLL (dll6.dll) and (tries to) call an
exported function in it to narrow down the problem.
The DLL is generated with VS2005 SP1 and with the File | New Project |
Visual C++ | Smart Device Wizard.
I use another VS2005 SP1 + PB plugin instance to debug my Windows CE 6.0
image. I tried using conmanclient2.exe (build 8.0.50727.762 12/2/2006 3:07)
to deploy and debug, but as conmanclient2.exe also loads the DLL in memory I
am suffering the same problem here.
So next I deploy my test exe+dll via the CE FTP server. If I now run the
test program, I get the following stack trace (similar as with conmanclient2)
Call stack
KERNEL!PageInModule(_PROCESS * 0x834b83f0, _MODULE * 0x835527e4, unsigned
long 0x419d5000, int 0x00000001) line 2123 + 66 bytes
KERNEL!PageFromLoader(_PROCESS * 0x834b83f0, unsigned long 0x419d5000, int
0x00000000) line 3859 + 21 bytes
KERNEL!VMProcessPageFault(_PROCESS * 0x834b83f0, unsigned long 0x419d5000,
int 0x00000000) line 1202 + 15 bytes
KERNEL!MDHandleHardwareException(_CALLSTACK * 0xd31afbfc, _EXCEPTION_RECORD
* 0xd31afbac, _CONTEXT * 0xd31afae0, unsigned long * 0xd31afab4) line 435 +
28 bytes
KERNEL!ExceptionDispatch(_EXCEPTION_RECORD * 0xd31afbac, _CONTEXT *
0xd31afae0) line 932 + 21 bytes
KERNEL!CaptureContext() line 542
COREDLL!DoImportAndCallDllMain(_USERMODULELIST * 0x3e0217b0) line 827 + 19
bytes
COREDLL!DoLoadLibrary(const unsigned short * 0x00013858, unsigned long
0x00000000) line 352 + 9 bytes
COREDLL!int_LoadLibraryExW(const unsigned short * 0x00013858, void *
0x00000000, unsigned long 0x00000000) line 1270 + 13 bytes
COREDLL!stub_LoadLibraryExW(const unsigned short * 0x00013858, void *
0x00000000, unsigned long 0x00000000) line 27 + 17 bytes
COREDLL!LoadLibraryExW(const unsigned short * 0x00013858, void * 0x00000000,
unsigned long 0x00000000) line 1245 + 17 bytes
COREDLL!LoadLibraryW(const unsigned short * 0x00013858) line 1286 + 13 bytes
Exe6!00011038()
Exe6!00011228()
Exe6!00011115()
COREDLL!MainThreadBaseFunc(void * 0x00011100, const unsigned short *
0x3e01fc5c, const unsigned short * 0x3e01fc70, HINSTANCE__ * 0x8f6fa630,
HINSTANCE__ * 0x00000000, HINSTANCE__ * 0x00000000) line 1068 + 60 bytes
The page fault actually occurs at
C:\WINCE600\PRIVATE\WINCEOS\COREOS\CORE\DLL\LOADER.CPP at line 718.
line 711: PCImpHdr blockstart = (PCImpHdr) (dwBaseAddr+pImpInfo->rva);
line 712: PCImpHdr blockptr;
line 718: for (blockptr = blockstart; !dwErr && blockptr->imp_lookup;
blockptr++) { --> crash, page fault
At that time the code tries to access some data from the DLL loaded in
memory, but the pImpInfo->rva (rel virt addr) doesn't point to a valid memory
address I think (or it was not loaded in memory)
This only happens with DLLs built with VS2005 SP1 as SmartDevice applications.
I tried this with COM Dlls and normal Dlls loaded manually with
LoadLibrary() and GetProcAddress(), both generated by the VS2005 smart device
Wizard.
DLLs built with VS2005 SP1 + PB as Windows CE DLLs part of NK.BIN don't have
this problem.
I also tried to built the DLLs with VS2005 without SP1, but still the same
problem.
If I write a small EXE that doesn't load any own built (smart device or user
-for that matter-) DLLs, I have no problem. (Except that NK.BIN image is
floated with "Calling xxx_SetProcPermissions" originated from
conmanclient2.exe, but doesn't seem to cause any damage)
Anyone (MS?) that might have an idea what is going wrong or anyone faced the
same problem?
Werner
.
- Follow-Ups:
- Re: Page Fault while loading DLLs in CE6.0!!
- From: Ross Jordan [MSFT]
- Re: Page Fault while loading DLLs in CE6.0!!
- Prev by Date: Re: Accessing mouse pointer
- Next by Date: Re: Accessing mouse pointer
- Previous by thread: Re: Loading an Image without platform builder
- Next by thread: Re: Page Fault while loading DLLs in CE6.0!!
- Index(es):
Relevant Pages
|