Hi,
Below is the initialisation code of PDV.EXE (a), the app that
calls DISP.EXE and thens set's up DDE.
Both are 16bit. I have added some comments to try and
clarify the code. I have also added the output of
wine --debugmsg +dll,+shell,+ddeml PDV.EXE (b).
Yesterday, I ran winedbg and set a breakpoint on DDeConnect.
A backtrace from the function is below (c).
The step through the function showed that
HCONV WINAPI DdeConnect(DWORD idInst, HSZ hszService, HSZ hszTopic,
LPCONVCONTEXT pCC)
....
if (pInstance->unicode)
/*This is false so CreateWindowA gets called */
....
pConv = WDML_GetConvFromWnd(hwndClient);
/*
winedbg> print pConv
0x00000000
Seems pConv is null
*/
if (pConv == NULL || pConv->hwndServer == 0)
{
/* Flow goes here and execution stops */
...
Thanks,
Miguel
(a) Code from PDV.EXE
void CALLBACK _export InitDisplay(HWND hWnd)
{
/* Call DISP.EXE */
if (ShellExecute(hWnd, "open",
PDVROT_szDisplay, "",
PDVROT_szPDVPath, SW_SHOWNORMAL) <= (HINSTANCE) 32)
{
HandleOutput("ERROR: DISPLAY PDV.");
return;
}
WaitAppActivate(DISPLAYTITLE);
if (DdeInitialize((LPDWORD) & idInst,
(PFNCALLBACK) DDECallback, APPCMD_CLIENTONLY, 0L))
{
HandleOutput("ERROR failed to init DDE DISPLAY PDV.");
return;
}
hszService = DdeCreateStringHandle(idInst, DISPLAYTITLE, CP_WINANSI);
hszTopic = DdeCreateStringHandle(idInst, "Form1", CP_WINANSI);
hszItem = DdeCreateStringHandle(idInst, "label1", CP_WINANSI);
/* Connect with DDE server (DISPLAY) */
hConv = DdeConnect(idInst, hszService, hszTopic, (PCONVCONTEXT) NULL);
if (hConv == NULL)
{
HandleError(DdeGetLastError(idInst));
HandleOutput("ERROR could not connect DISPLAY.");
/*
Control goes here and the App fails with the above message
This code is written with Borland C++^M
*/
}
(b) wine --debugmsg +dll,+shell,+ddeml PDV.EXE
Could not stat /mnt/fd0 (No such file or directory), ignoring drive A:
Could not stat /cdrom (No such file or directory), ignoring drive D:
trace:dll:fill_init_list (KRNL386.EXE) - START
trace:dll:fill_init_list (KRNL386.EXE) - END
trace:dll:fill_init_list (system.dll) - START
trace:dll:fill_init_list (system.dll) - END
trace:dll:fill_init_list (wprocs.dll) - START
trace:dll:fill_init_list (wprocs.dll) - END
trace:dll:fill_init_list (GDI.EXE) - START
trace:dll:fill_init_list (GDI.EXE) - END
trace:dll:fill_init_list (USER.EXE) - START
trace:dll:fill_init_list (USER.EXE) - END
trace:dll:fill_init_list (display.dll) - START
trace:dll:fill_init_list (display.dll) - END
fixme:keyboard:X11DRV_KEYBOARD_DetectLayout Your keyboard layout was not found!
Using closest match instead (Brazilian ABNT-2 keyboard layout) for scancode
mapping.
Please define your layout in windows/x11drv/keyboard.c and submit them
to us for inclusion into future Wine releases.
See the Wine User Guide, chapter "Keyboard" for more information.
trace:dll:fill_init_list (mmsystem.dll) - START
trace:dll:fill_init_list (mmsystem.dll) - END
trace:dll:NE_CallDllEntryPoint Calling mmsystem.dll DllEntryPoint,
cs:ip=00e7:0aa9
trace:shell:SHLWAPI_LibMain 0x40db4000 0x1 (nil)
trace:shell:Shell32LibMain 0x40cd6000 0x1 (nil)
trace:shell:SIC_Initialize
trace:shell:SIC_IconAppend shell32.dll 1 3e6 3ee
trace:shell:SHAlloc 20 bytes at 0x403dad4c
trace:shell:PathFindFileNameA shell32.dll
trace:shell:SIC_IconAppend shell32.dll 2 3e6 3ee
trace:shell:SHAlloc 20 bytes at 0x403dae4c
trace:shell:PathFindFileNameA shell32.dll
trace:shell:SIC_IconAppend shell32.dll 3 3f6 3fe
trace:shell:SHAlloc 20 bytes at 0x403dbf2c
trace:shell:PathFindFileNameA shell32.dll
trace:shell:SIC_IconAppend shell32.dll 4 406 406
trace:shell:SHAlloc 20 bytes at 0x403dc2d4
trace:shell:PathFindFileNameA shell32.dll
trace:shell:SIC_IconAppend shell32.dll 5 3e6 3ee
trace:shell:SHAlloc 20 bytes at 0x403daeac
trace:shell:PathFindFileNameA shell32.dll
trace:shell:SIC_IconAppend shell32.dll 6 3e6 3ee
trace:shell:SHAlloc 20 bytes at 0x403dd954
trace:shell:PathFindFileNameA shell32.dll
trace:shell:SIC_IconAppend shell32.dll 7 3e6 3ee
trace:shell:SHAlloc 20 bytes at 0x403dd994
trace:shell:PathFindFileNameA shell32.dll
trace:shell:SIC_IconAppend shell32.dll 8 40e 416
trace:shell:SHAlloc 20 bytes at 0x403dde2c
trace:shell:PathFindFileNameA shell32.dll
trace:shell:SIC_IconAppend shell32.dll 9 3e6 3ee
trace:shell:SHAlloc 20 bytes at 0x403dda14
trace:shell:PathFindFileNameA shell32.dll
trace:shell:SIC_IconAppend shell32.dll 10 3e6 3ee
trace:shell:SHAlloc 20 bytes at 0x403dda54
trace:shell:PathFindFileNameA shell32.dll
trace:shell:SIC_IconAppend shell32.dll 11 3e6 3ee
trace:shell:SHAlloc 20 bytes at 0x403dda94
trace:shell:PathFindFileNameA shell32.dll
trace:shell:SIC_IconAppend shell32.dll 12 3e6 3ee
trace:shell:SHAlloc 20 bytes at 0x403deb14
trace:shell:PathFindFileNameA shell32.dll
trace:shell:SIC_IconAppend shell32.dll 13 3e6 3ee
trace:shell:SHAlloc 20 bytes at 0x403deb54
trace:shell:PathFindFileNameA shell32.dll
trace:shell:SIC_IconAppend shell32.dll 14 3e6 3ee
trace:shell:SHAlloc 20 bytes at 0x403deb94
trace:shell:PathFindFileNameA shell32.dll
trace:shell:SIC_IconAppend shell32.dll 15 41e 426
trace:shell:SHAlloc 20 bytes at 0x403df02c
trace:shell:PathFindFileNameA shell32.dll
trace:shell:SIC_IconAppend shell32.dll 16 3e6 3ee
trace:shell:SHAlloc 20 bytes at 0x403dec14
trace:shell:PathFindFileNameA shell32.dll
trace:shell:SIC_IconAppend shell32.dll 17 3e6 3ee
trace:shell:SHAlloc 20 bytes at 0x403dec54
trace:shell:PathFindFileNameA shell32.dll
trace:shell:SIC_IconAppend shell32.dll 18 3e6 3ee
trace:shell:SHAlloc 20 bytes at 0x403dec94
trace:shell:PathFindFileNameA shell32.dll
trace:shell:SIC_IconAppend shell32.dll 19 3e6 3ee
trace:shell:SHAlloc 20 bytes at 0x403dfd14
trace:shell:PathFindFileNameA shell32.dll
trace:shell:SIC_IconAppend shell32.dll 20 3e6 3ee
trace:shell:SHAlloc 20 bytes at 0x403dfd54
trace:shell:PathFindFileNameA shell32.dll
trace:shell:SIC_IconAppend shell32.dll 21 3e6 3ee
trace:shell:SHAlloc 20 bytes at 0x403dfd94
trace:shell:PathFindFileNameA shell32.dll
trace:shell:SIC_IconAppend shell32.dll 22 3e6 3ee
trace:shell:SHAlloc 20 bytes at 0x403dfdd4
trace:shell:PathFindFileNameA shell32.dll
trace:shell:SIC_IconAppend shell32.dll 23 3e6 3ee
trace:shell:SHAlloc 20 bytes at 0x403dfe14
trace:shell:PathFindFileNameA shell32.dll
trace:shell:SIC_IconAppend shell32.dll 24 3e6 3ee
trace:shell:SHAlloc 20 bytes at 0x403dfe54
trace:shell:PathFindFileNameA shell32.dll
trace:shell:SIC_IconAppend shell32.dll 25 3e6 3ee
trace:shell:SHAlloc 20 bytes at 0x403dfe94
trace:shell:PathFindFileNameA shell32.dll
trace:shell:SIC_IconAppend shell32.dll 26 3e6 3ee
trace:shell:SHAlloc 20 bytes at 0x403dfed4
trace:shell:PathFindFileNameA shell32.dll
trace:shell:SIC_IconAppend shell32.dll 27 3e6 3ee
trace:shell:SHAlloc 20 bytes at 0x403dff14
trace:shell:PathFindFileNameA shell32.dll
trace:shell:SIC_IconAppend shell32.dll 28 3e6 3ee
trace:shell:SHAlloc 20 bytes at 0x403dff54
trace:shell:PathFindFileNameA shell32.dll
trace:shell:SIC_IconAppend shell32.dll 29 3e6 3ee
trace:shell:SHAlloc 20 bytes at 0x403dff94
trace:shell:PathFindFileNameA shell32.dll
trace:shell:SIC_IconAppend shell32.dll 30 3e6 3ee
trace:shell:SHAlloc 20 bytes at 0x403dffd4
trace:shell:PathFindFileNameA shell32.dll
trace:shell:SIC_IconAppend shell32.dll 31 3e6 3ee
trace:shell:SHAlloc 20 bytes at 0x403e0014
trace:shell:PathFindFileNameA shell32.dll
trace:shell:SIC_IconAppend shell32.dll 32 3e6 3ee
trace:shell:SHAlloc 20 bytes at 0x403e0054
trace:shell:PathFindFileNameA shell32.dll
trace:shell:SIC_IconAppend shell32.dll 33 3e6 3ee
trace:shell:SHAlloc 20 bytes at 0x403e0094
trace:shell:PathFindFileNameA shell32.dll
trace:shell:SIC_IconAppend shell32.dll 34 42e 436
trace:shell:SHAlloc 20 bytes at 0x403e1034
trace:shell:PathFindFileNameA shell32.dll
trace:shell:SIC_IconAppend shell32.dll 35 3e6 3ee
trace:shell:SHAlloc 20 bytes at 0x403dab6c
trace:shell:PathFindFileNameA shell32.dll
trace:shell:SIC_IconAppend shell32.dll 36 3e6 3ee
trace:shell:SHAlloc 20 bytes at 0x403dabac
trace:shell:PathFindFileNameA shell32.dll
trace:shell:SIC_IconAppend shell32.dll 37 3e6 3ee
trace:shell:SHAlloc 20 bytes at 0x403dabec
trace:shell:PathFindFileNameA shell32.dll
trace:shell:SIC_IconAppend shell32.dll 38 3e6 3ee
trace:shell:SHAlloc 20 bytes at 0x403e1d1c
trace:shell:PathFindFileNameA shell32.dll
trace:shell:SIC_Initialize hIconSmall=0x40e5013c hIconBig=0x40e501c8
trace:shell:InitChangeNotifications head=0x40d20dc0 tail=0x40d20de0
trace:shell:SHInitRestricted ((nil), (nil))
trace:dll:NE_InitDLL Calling LibMain, cs:ip=0337:0000 ds=0387 di=0386 cx=1000
trace:dll:NE_InitDLL Calling LibMain, cs:ip=046f:0000 ds=0597 di=0596 cx=3e80
trace:dll:NE_InitDLL Calling LibMain, cs:ip=05b7:0000 ds=0617 di=0616 cx=0000
trace:dll:NE_InitDLL Calling LibMain, cs:ip=02f7:0000 ds=0317 di=0316 cx=0000
trace:dll:NE_InitDLL Calling LibMain, cs:ip=065f:0000 ds=06c7 di=06c6 cx=0200
trace:dll:fill_init_list (C:\Regis\PDV.EXE) - START
trace:dll:fill_init_list (C:\REGIS\BORDCHQ.DLL) - START
trace:dll:fill_init_list (C:\REGIS\PDVROT.DLL) - START
trace:dll:fill_init_list (ddeml.dll) - START
trace:dll:fill_init_list (ddeml.dll) - END
trace:dll:fill_init_list (KRNL386.EXE) - START
trace:dll:fill_init_list (KRNL386.EXE) - END
trace:dll:fill_init_list (shell.dll) - START
trace:dll:fill_init_list (shell.dll) - END
trace:dll:fill_init_list (USER.EXE) - START
trace:dll:fill_init_list (USER.EXE) - END
trace:dll:fill_init_list (win87em.dll) - START
trace:dll:fill_init_list (win87em.dll) - END
trace:dll:fill_init_list (C:\REGIS\PDVROT.DLL) - END
trace:dll:fill_init_list (C:\REGIS\BD.DLL) - START
trace:dll:fill_init_list (C:\REGIS\BD.DLL) - END
trace:dll:fill_init_list (C:\REGIS\IFDT.DLL) - START
trace:dll:fill_init_list (C:\REGIS\IFDT.DLL) - END
trace:dll:fill_init_list (C:\REGIS\BORDCHQ.DLL) - END
trace:dll:fill_init_list (C:\REGIS\E$WIN.DLL) - START
trace:dll:fill_init_list (C:\REGIS\E$WIN.DLL) - END
trace:dll:fill_init_list (C:\REGIS\BWCC.DLL) - START
trace:dll:fill_init_list (GDI.EXE) - START
trace:dll:fill_init_list (GDI.EXE) - END
trace:dll:fill_init_list (C:\REGIS\BWCC.DLL) - END
trace:dll:fill_init_list (keyboard.dll) - START
trace:dll:fill_init_list (keyboard.dll) - END
trace:dll:fill_init_list (C:\Regis\PDV.EXE) - END
trace:dll:NE_CallDllEntryPoint Calling shell.dll DllEntryPoint, cs:ip=03d7:0327
trace:shell:SHELL_DllEntryPoint (00000001, 03df, 03df, 0000, 00000000, 0000)
trace:shell:ShellExecute16 (0021,'open','C:\REGIS\DISP.EXE','','C:\REGIS\',1)
trace:shell:SHLWAPI_LibMain 0x40db4000 0x2 (nil)
trace:dll:fill_init_list (C:\REGIS\DISP.EXE) - START
trace:dll:fill_init_list (C:\REGIS\BWCC.DLL) - START
trace:dll:fill_init_list (GDI.EXE) - START
trace:dll:fill_init_list (GDI.EXE) - END
trace:dll:fill_init_list (KRNL386.EXE) - START
trace:dll:fill_init_list (KRNL386.EXE) - END
trace:dll:fill_init_list (USER.EXE) - START
trace:dll:fill_init_list (USER.EXE) - END
trace:dll:fill_init_list (C:\REGIS\BWCC.DLL) - END
trace:dll:fill_init_list (ddeml.dll) - START
trace:dll:fill_init_list (ddeml.dll) - END
trace:dll:fill_init_list (mmsystem.dll) - START
trace:dll:fill_init_list (mmsystem.dll) - END
trace:dll:fill_init_list (C:\REGIS\DISP.EXE) - END
trace:dll:NE_CallDllEntryPoint Calling mmsystem.dll DllEntryPoint,
cs:ip=00e7:0aa9
trace:ddeml:WDML_Initialize (0x40f94290,0x88700ba,0x0,0)
trace:ddeml:WDML_Initialize instance created - checking validity
trace:ddeml:WDML_Initialize new instance, callback 0x88700ba flags 0
trace:ddeml:WDML_Initialize First application instance detected OK
trace:ddeml:WDML_IncrementInstanceId New instance id 1 allocated
trace:ddeml:WDML_Initialize New application instance processing finished OK
trace:ddeml:DdeCreateStringHandleA (1,0x40f94755,1004)
trace:ddeml:WDML_CreateString added atom "DISP" with HSZ 0xc000,
trace:ddeml:DdeCreateStringHandleA (1,0x40f9475a,1004)
trace:ddeml:WDML_CreateString added atom "Form1" with HSZ 0xc001,
trace:ddeml:DdeCreateStringHandleA (1,0x40f94760,1004)
trace:ddeml:WDML_CreateString added atom "label1" with HSZ 0xc002,
trace:ddeml:DdeNameService (1,0xc000,0x0,1)
trace:ddeml:WDML_FindServer Service name missing
trace:ddeml:DdeNameService Adding service name
trace:ddeml:DdeQueryStringA (1, 0xc000, 0x411a62c4, 256, 1004)
trace:ddeml:DdeQueryStringA returning "DISP"
trace:ddeml:DdeCreateStringHandleA (1,0x411a61c4,1004)
trace:ddeml:WDML_CreateString added atom "DISP(0x0806b3c8)" with HSZ 0xc003,
trace:ddeml:DdeNameService Created nameServer=10025 for instance=00000001
trace:ddeml:WDML_Initialize (0x403d3400,0x33f015d,0x10,0)
trace:ddeml:WDML_Initialize instance created - checking validity
trace:ddeml:WDML_Initialize new instance, callback 0x33f015d flags 10
trace:ddeml:WDML_Initialize Subsequent application instance - starting checks
trace:ddeml:WDML_Initialize Application Instance checks finished
trace:ddeml:WDML_IncrementInstanceId New instance id 2 allocated
trace:ddeml:WDML_Initialize New application instance processing finished OK
trace:ddeml:DdeCreateStringHandleA (2,0x403c54f8,1004)
trace:ddeml:WDML_CreateString added atom "DISP" with HSZ 0xc000,
trace:ddeml:DdeCreateStringHandleA (2,0x403c54fd,1004)
trace:ddeml:WDML_CreateString added atom "Form1" with HSZ 0xc001,
trace:ddeml:DdeCreateStringHandleA (2,0x403c5503,1004)
trace:ddeml:WDML_CreateString added atom "label1" with HSZ 0xc002,
trace:ddeml:DdeConnect (0x2,0xc000,0xc001,(nil))
trace:ddeml:WDML_ServerNameProc WM_DDE_INITIATE message received!
trace:ddeml:WDML_ServerNameProc idInst=1, threadID=0x8073d60
trace:ddeml:WDML_MakeHszFromAtom c026 => L"DISP"
trace:ddeml:DdeCreateStringHandleW (1,0x411a63e4,1200)
trace:ddeml:WDML_CreateString added atom L"DISP" with HSZ 0xc000,
trace:ddeml:WDML_MakeHszFromAtom c02e => L"Form1"
trace:ddeml:DdeCreateStringHandleW (1,0x411a63dc,1200)
trace:ddeml:WDML_CreateString added atom L"Form1" with HSZ 0xc001,
trace:ddeml:DdeCmpStringHandles (c000<L"DISP"> c000<L"DISP">);
trace:ddeml:WDML_InvokeCallback invoking CB16[088700ba] (4194 0 00000000 0xc001
0xc000 0 1092249376 0)
trace:ddeml:WDML_InvokeCallback done => 00000000
err:ddeml:DdeConnect Done with INITIATE, but no Server window available
fixme:ddeml:DdeGetLastError (2): error reporting is weakly implemented
trace:ddeml:WDML_Initialize (0x40f94290,0x88700c2,0x0,0)
trace:ddeml:WDML_Initialize instance created - checking validity
trace:ddeml:WDML_Initialize reinitialisation of (0x40f94290,0x88700c2,0x0,0):
stub
trace:ddeml:WDML_MakeHszFromAtom c026 => L"DISP"
trace:ddeml:DdeCreateStringHandleW (1,0x411a68ac,1200)
trace:ddeml:WDML_CreateString added atom L"DISP" with HSZ 0xc000,
trace:ddeml:WDML_MakeHszFromAtom c02b => L"DISP(0x0806b3c8)"
trace:ddeml:DdeCreateStringHandleW (1,0x411a68a4,1200)
trace:ddeml:WDML_CreateString added atom L"DISP(0x0806b3c8)" with HSZ 0xc003,
trace:ddeml:WDML_InvokeCallback invoking CB16[088700ba] (32930 0 00000000 0xc000
0xc003 0 0 0)
trace:ddeml:WDML_InvokeCallback done => 00000000
trace:dll:NE_InitDLL Calling LibMain, cs:ip=08d7:0000 ds=08df di=08df cx=1000
trace:dll:fill_init_list (C:\REGIS\COMUM.DLL) - START
trace:dll:fill_init_list (KRNL386.EXE) - START
trace:dll:fill_init_list (KRNL386.EXE) - END
trace:dll:fill_init_list (USER.EXE) - START
trace:dll:fill_init_list (USER.EXE) - END
trace:dll:fill_init_list (C:\REGIS\COMUM.DLL) - END
fixme:dialog:MSGBOX_OnInit system modal msgbox ! Not modal yet.
(c) backtrace from DdeConnect
=>0 0x40624070 (DdeConnect(idInst=0x2, hszService=0xc000, hszTopic=0xc001,
pCC=0x0) [client.c:87] in libuser32.so) (ebp=40ca6bbc)
1 0x40620447 (DDEML_CallFrom16_p_long_lllp+0x3b(proc=0x4062614c,
args=0x403b5f96) [ddeml.spec.c:62] in libuser32.so) (ebp=40ca6be0)
2 0x4008f21a (__wine_call_from_16_long+0x8e [relay16.s] in libntdll.so)
(ebp=40ca6c10)
3 0x033f:0x075c (bp=a66c)
4 0x028f:0x0c52 (bp=a904)
5 0x0287:0x00e0 (bp=0000)
It seems that functions 3, 4 and 5 are from PDV.EXE.
I should recompile PDV.EXE to include debugging symbols.
-------------------------------------------------
This mail sent through IMP: webmail.vmn.com.br