Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DirBox in VB3 Shows Long File Paths Instead of Short Names, Breaks App - Can't select folders with spaces #1175

Closed
chentiangemalc opened this issue Jul 27, 2022 · 2 comments · Fixed by #1176

Comments

@chentiangemalc
Copy link

Describe the bug
The VB3 DirBox normally in Windows XP shows Short File Paths, but under OTVDM shows long file paths. Seems to be using a 32-bit control as the FindFirstFileW doesn't seem to originate from otvdm.

0:004> .printf "%mu",poi(@esp+4)
c:\*.*
0:004> kp
 # ChildEBP RetAddr      
00 07ec57d8 76084a91     KERNELBASE!FindFirstFileW
01 07ec5ea8 7607f16e     USER32!xxxLbDir+0xa5
02 07ec5f38 7607ea12     USER32!ListBoxWndProcWorker+0x6ae
03 07ec5f64 76047c92     USER32!ListBoxWndProcA+0x52
04 07ec5f90 7602714a     USER32!_InternalCallWinProc+0x2a
05 07ec6080 7603d092     USER32!UserCallWinProcCheckWow+0x4aa
06 07ec60b8 7c4aac73     USER32!CallWindowProcA+0x82
07 07ec61b8 7c4afea6     user!call_window_proc_callback(struct HWND__ * hwnd = 0x000a0948, unsigned int msg = 0x18d, unsigned int wp = 0x8010, long lp = 0n133021906, long * result = 0x07ec6cb8, void * arg = 0x77878500)+0x53 [C:\winevdm-master\user\message.c @ 189] 
08 07ec63a8 7c4a1da3     user!listbox_proc_CallProc16To32A(<function> * callback = 0x7c4aac20, struct HWND__ * hwnd = 0x000a0948, unsigned int msg = 0x18d, unsigned int wParam = 0x8010, long lParam = 0n133021906, int unicode = 0n0, long * result = 0x07ec6cb8, void * arg = 0x77878500, int * f = 0x07ec6b70)+0x636 [C:\winevdm-master\user\message.c @ 1040] 
09 07ec6bb8 7c49e4ee     user!WINPROC_CallProc16To32A(<function> * callback = 0x7c4aac20, unsigned short hwnd = 0x2a3, unsigned short msg = 0x40e, unsigned short wParam = 0x8010, long lParam = 0n342329954, long * result = 0x07ec6cb8, void * arg = 0x77878500)+0x113 [C:\winevdm-master\user\message.c @ 1364] 
0a 07ec6ccc 7c0d660f     user!CallWindowProc16(<function> * func = 0x164f0054, unsigned short hwnd = 0x2a3, unsigned short msg = 0x40e, unsigned short wParam = 0x8010, long lParam = 0n342329954)+0xce [C:\winevdm-master\user\message.c @ 2921] 
0b 07ec6de4 7c0d820e     krnl386!call_entry_point(void * func = 0x7c47ca55, int nb_args = 0n5, int * args = 0x07ec6ee4)+0x4f [C:\winevdm-master\krnl386\relay.c @ 350] 
0c 07ec6f60 7c0d752a     krnl386!relay_call_from_16_no_debug(void * entry_point = 0x7c47ca55, unsigned char * args16 = 0x07edbf74 "b???", struct _CONTEXT * context = 0x07ec7c6c, struct CALLFROM16 * call = 0x07a7ab74)+0x2ce [C:\winevdm-master\krnl386\relay.c @ 481] 
0d 07ec716c 7bdc34a7     krnl386!relay_call_from_16(void * entry_point = 0x7c47ca55, unsigned char * args16 = 0x07edbf74 "b???", struct _CONTEXT * context = 0x07ec7c6c)+0xfa [C:\winevdm-master\krnl386\relay.c @ 518] 
0e 07ec8334 7bdc4fcc     vm86!vm86main(struct _CONTEXT * context = 0x07ec889c, unsigned long cbArgs = 0xe, <function> * handler = 0x7c104560, <function> * from16_reg = 0x7c058ce9, <function> * __wine_call_from_16 = 0x7c05967b, <function> * relay_call_from_16 = 0x7c0598c4, <function> * __wine_call_to_16_ret = 0x7c060788, int dasm = 0n0, unsigned char * memory_base = 0x00000000 "", <function> * pih = 0x7c0582e4)+0x987 [C:\winevdm-master\vm86\msdos.cpp @ 1669] 
0f 07ec8434 7c0e3e54     vm86!wine_call_to_16_regs_vm86(struct _CONTEXT * context = 0x07ec889c, unsigned long cbArgs = 0xe, <function> * handler = 0x7c104560, <function> * from16_reg = 0x7c058ce9, <function> * __wine_call_from_16 = 0x7c05967b, <function> * relay_call_from_16 = 0x7c0598c4, <function> * __wine_call_to_16_ret = 0x7c060788, int dasm = 0n0, bool vm86 = false, void * memory_base = 0x07900000, <function> * pih = 0x7c0582e4)+0x9c [C:\winevdm-master\vm86\msdos.cpp @ 1139] 
10 07ec8534 7c103412     krnl386!wine_call_to_16_regs(struct _CONTEXT * context = 0x07ec889c, unsigned long cbArgs = 0xe, <function> * handler = 0x7c104560)+0x94 [C:\winevdm-master\krnl386\stub.c @ 154] 
11 07ec869c 7c4aa9de     krnl386!K32WOWCallback16Ex(unsigned long vpfn16 = 0, unsigned long dwFlags = 2, unsigned long cbArgs = 0xe, void * pArgs = 0x07ec885c, unsigned long * pdwRetCode = 0x07ec889c)+0x372 [C:\winevdm-master\krnl386\wowthunk.c @ 683] 
12 07ec8b88 7c4a60db     user!call_window_proc16(unsigned short hwnd = 0x2a1, unsigned short msg = 0x111, unsigned short wParam = 1, long lParam = 0n131747, long * result = 0x07ec9fc4, void * arg = 0x12ef0000)+0x2be [C:\winevdm-master\user\message.c @ 386] 
13 07ec9eb8 7c4a9452     user!WINPROC_CallProc32ATo16(<function> * callback = 0x7c47d469, struct HWND__ * hwnd = 0x00090aa4, unsigned int msg = 0x111, unsigned int wParam = 0x20001, long lParam = 0n131747, long * result = 0x07ec9fc4, void * arg = 0x12ef0000)+0x13bb [C:\winevdm-master\user\message.c @ 2234] 
14 07eca024 76047c92     user!WindowProc16(struct HWND__ * hDlg = 0x00090aa4, unsigned int Msg = 0x111, unsigned int wParam = 0x20001, long lParam = 0n657736)+0x1f2 [C:\winevdm-master\user\message.c @ 5116] 
15 07eca050 7602714a     USER32!_InternalCallWinProc+0x2a
16 07eca140 76026bda     USER32!UserCallWinProcCheckWow+0x4aa
17 07eca1a4 7602faaf     USER32!DispatchClientMessage+0xea
18 07eca1e0 7785719c     USER32!__fnDWORD+0x3f
19 07eca218 75fe10dc     ntdll!KiUserCallbackDispatcher+0x4c
1a 07eca21c 760269db     win32u!NtUserMessageCall+0xc
1b 07eca280 7604e1cc     USER32!SendMessageWorker+0x9cb
1c 07eca2a4 76025c96     USER32!SendMessageInternal+0x2d
1d 07eca2c0 76083550     USER32!SendMessageW+0x46
1e 07eca2e0 76081bf4     USER32!xxxNotifyOwner+0x36
1f 07eca300 76083d59     USER32!xxxLBButtonUp+0x149
20 07eca358 7607efe1     USER32!xxxTrackMouse+0x671
21 07eca3f4 7607ea12     USER32!ListBoxWndProcWorker+0x521
22 07eca420 76047c92     USER32!ListBoxWndProcA+0x52
23 07eca44c 7602714a     USER32!_InternalCallWinProc+0x2a
24 07eca53c 7603d092     USER32!UserCallWinProcCheckWow+0x4aa
25 07eca574 7c4aac73     USER32!CallWindowProcA+0x82
26 07eca674 7c4a3cfd     user!call_window_proc_callback(struct HWND__ * hwnd = 0x000a0948, unsigned int msg = 0x203, unsigned int wp = 1, long lp = 0n852003, long * result = 0x07ecaf78, void * arg = 0x77878500)+0x53 [C:\winevdm-master\user\message.c @ 189] 
27 07ecae78 7c49e4ee     user!WINPROC_CallProc16To32A(<function> * callback = 0x7c4aac20, unsigned short hwnd = 0x2a3, unsigned short msg = 0x203, unsigned short wParam = 1, long lParam = 0n852003, long * result = 0x07ecaf78, void * arg = 0x77878500)+0x206d [C:\winevdm-master\user\message.c @ 1878] 
28 07ecaf8c 7c0d660f     user!CallWindowProc16(<function> * func = 0x164f0054, unsigned short hwnd = 0x2a3, unsigned short msg = 0x203, unsigned short wParam = 1, long lParam = 0n852003)+0xce [C:\winevdm-master\user\message.c @ 2921] 
29 07ecb0a4 7c0d820e     krnl386!call_entry_point(void * func = 0x7c47ca55, int nb_args = 0n5, int * args = 0x07ecb1a4)+0x4f [C:\winevdm-master\krnl386\relay.c @ 350] 
2a 07ecb220 7c0d752a     krnl386!relay_call_from_16_no_debug(void * entry_point = 0x7c47ca55, unsigned char * args16 = 0x07edc46e "#", struct _CONTEXT * context = 0x07ecbf2c, struct CALLFROM16 * call = 0x07a7ab74)+0x2ce [C:\winevdm-master\krnl386\relay.c @ 481] 
2b 07ecb42c 7bdc34a7     krnl386!relay_call_from_16(void * entry_point = 0x7c47ca55, unsigned char * args16 = 0x07edc46e "#", struct _CONTEXT * context = 0x07ecbf2c)+0xfa [C:\winevdm-master\krnl386\relay.c @ 518] 
2c 07ecc5f4 7bdc4fcc     vm86!vm86main(struct _CONTEXT * context = 0x07eccb5c, unsigned long cbArgs = 0xe, <function> * handler = 0x7c104560, <function> * from16_reg = 0x7c058ce9, <function> * __wine_call_from_16 = 0x7c05967b, <function> * relay_call_from_16 = 0x7c0598c4, <function> * __wine_call_to_16_ret = 0x7c060788, int dasm = 0n0, unsigned char * memory_base = 0x00000000 "", <function> * pih = 0x7c0582e4)+0x987 [C:\winevdm-master\vm86\msdos.cpp @ 1669] 
2d 07ecc6f4 7c0e3e54     vm86!wine_call_to_16_regs_vm86(struct _CONTEXT * context = 0x07eccb5c, unsigned long cbArgs = 0xe, <function> * handler = 0x7c104560, <function> * from16_reg = 0x7c058ce9, <function> * __wine_call_from_16 = 0x7c05967b, <function> * relay_call_from_16 = 0x7c0598c4, <function> * __wine_call_to_16_ret = 0x7c060788, int dasm = 0n0, bool vm86 = false, void * memory_base = 0x07900000, <function> * pih = 0x7c0582e4)+0x9c [C:\winevdm-master\vm86\msdos.cpp @ 1139] 
2e 07ecc7f4 7c103412     krnl386!wine_call_to_16_regs(struct _CONTEXT * context = 0x07eccb5c, unsigned long cbArgs = 0xe, <function> * handler = 0x7c104560)+0x94 [C:\winevdm-master\krnl386\stub.c @ 154] 
2f 07ecc95c 7c4aa9de     krnl386!K32WOWCallback16Ex(unsigned long vpfn16 = 0, unsigned long dwFlags = 2, unsigned long cbArgs = 0xe, void * pArgs = 0x07eccb1c, unsigned long * pdwRetCode = 0x07eccb5c)+0x372 [C:\winevdm-master\krnl386\wowthunk.c @ 683] 
30 07ecce48 7c49e493     user!call_window_proc16(unsigned short hwnd = 0x2a3, unsigned short msg = 0x203, unsigned short wParam = 1, long lParam = 0n852003, long * result = 0x07eccf44, void * arg = 0x12ef0000)+0x2be [C:\winevdm-master\user\message.c @ 386] 
31 07eccf58 7c49eef0     user!CallWindowProc16(<function> * func = 0x12ef0000, unsigned short hwnd = 0x2a3, unsigned short msg = 0x203, unsigned short wParam = 1, long lParam = 0n852003)+0x73 [C:\winevdm-master\user\message.c @ 2916] 
32 07ecd0dc 7c0d660f     user!DispatchMessage16(struct MSG16 * msg = 0x07edc622)+0x2a0 [C:\winevdm-master\user\message.c @ 3284] 
33 07ecd1e4 7c0d820e     krnl386!call_entry_point(void * func = 0x7c47d991, int nb_args = 0n1, int * args = 0x07ecd2e4)+0x4f [C:\winevdm-master\krnl386\relay.c @ 350] 
34 07ecd360 7c0d752a     krnl386!relay_call_from_16_no_debug(void * entry_point = 0x7c47d991, unsigned char * args16 = 0x07edc60c "???", struct _CONTEXT * context = 0x07ece06c, struct CALLFROM16 * call = 0x07a7aa54)+0x2ce [C:\winevdm-master\krnl386\relay.c @ 481] 
35 07ecd56c 7bdc34a7     krnl386!relay_call_from_16(void * entry_point = 0x7c47d991, unsigned char * args16 = 0x07edc60c "???", struct _CONTEXT * context = 0x07ece06c)+0xfa [C:\winevdm-master\krnl386\relay.c @ 518] 
36 07ece734 7bdc4fcc     vm86!vm86main(struct _CONTEXT * context = 0x07ecec60, unsigned long cbArgs = 4, <function> * handler = 0x7c104560, <function> * from16_reg = 0x7c058ce9, <function> * __wine_call_from_16 = 0x7c05967b, <function> * relay_call_from_16 = 0x7c0598c4, <function> * __wine_call_to_16_ret = 0x7c060788, int dasm = 0n0, unsigned char * memory_base = 0x00000000 "", <function> * pih = 0x7c0582e4)+0x987 [C:\winevdm-master\vm86\msdos.cpp @ 1669] 
37 07ece834 7c0e3e54     vm86!wine_call_to_16_regs_vm86(struct _CONTEXT * context = 0x07ecec60, unsigned long cbArgs = 4, <function> * handler = 0x7c104560, <function> * from16_reg = 0x7c058ce9, <function> * __wine_call_from_16 = 0x7c05967b, <function> * relay_call_from_16 = 0x7c0598c4, <function> * __wine_call_to_16_ret = 0x7c060788, int dasm = 0n0, bool vm86 = false, void * memory_base = 0x07900000, <function> * pih = 0x7c0582e4)+0x9c [C:\winevdm-master\vm86\msdos.cpp @ 1139] 
38 07ece934 7c103412     krnl386!wine_call_to_16_regs(struct _CONTEXT * context = 0x07ecec60, unsigned long cbArgs = 4, <function> * handler = 0x7c104560)+0x94 [C:\winevdm-master\krnl386\stub.c @ 154] 
39 07ecea9c 7c0cbf9c     krnl386!K32WOWCallback16Ex(unsigned long vpfn16 = 0, unsigned long dwFlags = 2, unsigned long cbArgs = 4, void * pArgs = 0x00000000, unsigned long * pdwRetCode = 0x07ecec60)+0x372 [C:\winevdm-master\krnl386\wowthunk.c @ 683] 
3a 07ecef94 7c0ec007     krnl386!NE_StartTask(void)+0x37c [C:\winevdm-master\krnl386\ne_module.c @ 1575] 
3b 07ecfbf4 75986739     krnl386!task_start(void * p = 0x05410368)+0x247 [C:\winevdm-master\krnl386\task.c @ 675] 
3c 07ecfc04 77848fef     KERNEL32!BaseThreadInitThunk+0x19
3d 07ecfc5c 77848fbd     ntdll!__RtlUserThreadStart+0x2b
3e 07ecfc6c 00000000     ntdll!_RtlUserThreadStart+0x1b

Expected behavior
Short file paths should be displayed i.e. instead of C:\Program Files C:\Progra~1 etc.

Screenshots
Broken Behavior
image

Environment (please complete the following information):

Windows 11

Additional context

Attached sample EXE and its source code in ZIP file

trace.txt

  1. Set the environment variable:
set WINEDEBUG=+all,-snoop,-ldt,-fixup,-module,-global,-local,-disasm,-syslevel,-thunk
*old-executable-file* 2> trace.txt
  1. Upload trace.txt here.
@chentiangemalc
Copy link
Author

test.zip

@otya128
Copy link
Owner

otya128 commented Jul 27, 2022

The program seems to be using LB_DIR to add files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants