Hello
after trying to workaround the problem, I found, that even when I just deploy the exe/dll to the device, the serial output shows me that(after power on the device, nothing was loaded before):
DLL_PROCESS_ATTACH, ProcessID: 0x63c2423a
Call from path \ffsdisk\conn\conmanclient2.exe
Call from ConManClient2, do nothing
DLL_PROCESS_DETACH, ProcessID: 0x63c2423a
Then I start the application, having a breakpoint in the DLL_PROCESS_ATTACH swtich:
DLL_PROCESS_ATTACH, ProcessID: 0x63c2423a
Call from path \ffsdisk\conn\conmanclient2.exe
Call from ConManClient2, do nothing
DLL_PROCESS_DETACH, ProcessID: 0x63c2423a
Then after the breakpoint this:
DLL_PROCESS_ATTACH, ProcessID: 0x 3b626ae
Call from path \ffsdisk\testEXE\testEXE.exe
Call from EXE
MUTEX CREATION OK, ProcessID: 0x 3b626ae
The code in the attach section:
- case DLL_PROCESS_ATTACH:
- {
- RETAILMSG(1, (_T("DLL_PROCESS_ATTACH, ProcessID: 0x%8x\r\n"), GetCurrentProcessId()));
- TCHAR szEXEPath[MAX_PATH];
- DWORD s = GetModuleFileName((HMODULE)GetCurrentProcessId(),szEXEPath,sizeof(szEXEPath));
- RETAILMSG(1, (_T("Call from path %s\r\n"), szEXEPath));
- WCHAR* pdest=NULL;
- pdest=wcsstr(szEXEPath,_T("conmanclient2.exe"));
- if(NULL==pdest)
- {
- RETAILMSG(1, (_T("Call from EXE\r\n")));
- SetLastError(0);
- int rc = GetLastError();
- g_hmWriteOkay = CreateMutex(NULL, NULL, _T("SomeDllMutex"));
- rc = GetLastError();
- if (rc == ERROR_ALREADY_EXISTS)
- {
- RETAILMSG(1, (_T("ERROR_ALREADY_EXISTS, ProcessID: 0x%8x\r\n"), GetCurrentProcessId()));
- }
- else
- {
- RETAILMSG(1, (_T("MUTEX CREATION OK, ProcessID: 0x%8x\r\n"), GetCurrentProcessId()));
- }
- }
- else if(NULL!=pdest)
- {
- RETAILMSG(1, (_T("Call from ConManClient2, do nothing\r\n")));
- }
- }
- break;
Display More