Hi,
I'm trying to implement stubs for some missing ordinal functions in shlwapi. Reading the NOTES comment in dlls/shlwapi/ordinal.c I don't know if it is a good idea, but it allows explorer.exe (Win 98) to show its desktop and it is what I'm testing (just for fun. I do not hope to be able to use it right now).
Anyway, it uses at a moment or another unimplemented ordinal functions. To implement their stubs, I begins with a lot of args, reducing this number until the function is passed. It seems to work but I wonder if I do not add only problems with this strategy. If I left the stack in a corrupted state, maybe the problem will become visible a lot later... I was not able to find in docs, mails archives or google groups any useful tip to find (simply) the right number of args. Particularly, the URL http://www.ece.cmu.edu/afs/ece/usr/dacut/www/src is dead.
So, do I continue ? If yes, in this way or differently ?
Thanks for your advices.
Gael.
PS: I will not read my mail until monday 28.
On Wed, May 23, 2001 at 06:01:51PM +0000, Gaël de Chalendar wrote: [...]
Anyway, it uses at a moment or another unimplemented ordinal functions. To implement their stubs, I begins with a lot of args, reducing this number until the function is passed. It seems to work but I wonder if I do not add only problems with this strategy. If I left the stack in a corrupted state, maybe the problem will become visible a lot later... I was not able to find in docs, mails archives or google groups any useful tip to find (simply) the right number of args. Particularly, the URL http://www.ece.cmu.edu/afs/ece/usr/dacut/www/src is dead.
So, do I continue ? If yes, in this way or differently ?
Differently.
You get a nice "crash" when the program hits an unimplemented function. Do a backtrace, then do a disas of the code that led to the unimplemented function. Count the number of pushes before that call. That's usually the number of arguments you need to use.
Le Mercredi 23 Mai 2001 17:19, Andreas Mohr a écrit :
You get a nice "crash" when the program hits an unimplemented function. Do a backtrace, then do a disas of the code that led to the unimplemented function. Count the number of pushes before that call. That's usually the number of arguments you need to use.
OK. Just to try I removed the stub for SHLWAPI_16. When asking for a backtrace (bt) in the wine debugger, I get the following. Where in that di I find the address where to disassemble ?
Unhandled exception: unimplemented function shlwapi.16 called in 32-bit code (0x40765056). In 32-bit mode. 0x40765056 (__wine_unimplemented+0x56 [shlwapi.spec.c:40] in SHLWAPI.DLL): jmp 0 x40765050 (__wine_unimplemented+0x50 [shlwapi.spec.c:40] in SHLWAPI.DLL) 43 void __wine_stub_shlwapi_4(void) { __wine_unimplemented("4"); } Wine-dbg>bt Backtrace: =>0 0x40765056 (__wine_unimplemented+0x56(func=0x40770eff) [shlwapi.spec.c:40] in SHLWAPI.DLL) (ebp=40566cb8) 1 0x40765170 (__wine_stub_shlwapi_17 [shlwapi.spec.c:53] in SHLWAPI.DLL) (ebp=40566cc8) 2 0x00403a1a (<Debugged process>.EntryPoint+0x95c in <Debugged process>) (ebp=40566e6c) 3 0x0040312c (<Debugged process>.EntryPoint+0x6e in <Debugged process>) (ebp=40566ecc) 4 0x400d0e92 (start_process+0x1d6 [process.c:403] in libntdll.so) (ebp=40566f30) 5 0x400d46b9 (SYSDEPS_DoCallOnStack+0x25(func=0x400d0cbc, arg=0x0) [sysdeps.c:173] in libntdll.so) (ebp=40566ff0) 6 0x400d4763 (SYSDEPS_CallOnStack+0x2f in libntdll.so) (ebp=bffff17c) 7 0x400d480d (SYSDEPS_SwitchToThreadStack+0x95(func=0x400d0cbc) [sysdeps.c:236] in libntdll.so) (ebp=bffff1b8) 8 0x400d11ef (PROCESS_InitWine+0x19f(argc=0x2, argv=0xbffff254, win16_exe_name=0x804c620, win16_exe_file=0x804c724) [process.c:525] in libntdll.so) (ebp=bffff1d4) 9 0x0804b1ee (Letext [main.c] in wine) (ebp=bffff1ec) 10 0x40236cbe (NTDLL.DLL.sqrt+0x3362e in libc.so.6) (ebp=bffff228) 11 0x08049021 (_start+0x21 in wine) (ebp=00000000)
Wine-dbg>bt Backtrace: =>0 0x40765056 (__wine_unimplemented+0x56(func=0x40770eff) [shlwapi.spec.c:40] in SHLWAPI.DLL) (ebp=40566cb8) 1 0x40765170 (__wine_stub_shlwapi_17 [shlwapi.spec.c:53] in SHLWAPI.DLL) (ebp=40566cc8) 2 0x00403a1a (<Debugged process>.EntryPoint+0x95c in <Debugged process>) (ebp=40566e6c)
this is the right caller... and in fact before the calling point doing twice up should bring you here, then you have to disas before the call to __wine_stub_shlwapi_1#
A+
On Fri, Jun 01, 2001 at 04:19:54PM +0000, Gaël de Chalendar wrote:
Le Mercredi 23 Mai 2001 17:19, Andreas Mohr a écrit :
You get a nice "crash" when the program hits an unimplemented function. Do a backtrace, then do a disas of the code that led to the unimplemented function. Count the number of pushes before that call. That's usually the number of arguments you need to use.
OK. Just to try I removed the stub for SHLWAPI_16. When asking for a backtrace (bt) in the wine debugger, I get the following. Where in that di I find the address where to disassemble ?
Unhandled exception: unimplemented function shlwapi.16 called in 32-bit code (0x40765056). In 32-bit mode. 0x40765056 (__wine_unimplemented+0x56 [shlwapi.spec.c:40] in SHLWAPI.DLL): jmp 0 x40765050 (__wine_unimplemented+0x50 [shlwapi.spec.c:40] in SHLWAPI.DLL) 43 void __wine_stub_shlwapi_4(void) { __wine_unimplemented("4"); } Wine-dbg>bt Backtrace: =>0 0x40765056 (__wine_unimplemented+0x56(func=0x40770eff) [shlwapi.spec.c:40] in SHLWAPI.DLL) (ebp=40566cb8) 1 0x40765170 (__wine_stub_shlwapi_17 [shlwapi.spec.c:53] in SHLWAPI.DLL) (ebp=40566cc8) 2 0x00403a1a (<Debugged process>.EntryPoint+0x95c in <Debugged process>) (ebp=40566e6c) 3 0x0040312c (<Debugged process>.EntryPoint+0x6e in <Debugged process>) (ebp=40566ecc) 4 0x400d0e92 (start_process+0x1d6 [process.c:403] in libntdll.so) (ebp=40566f30) 5 0x400d46b9 (SYSDEPS_DoCallOnStack+0x25(func=0x400d0cbc, arg=0x0) [sysdeps.c:173] in libntdll.so) (ebp=40566ff0)
Right before 0x403a1a, of course (since this is where the program calls from). So e.g. a disas 0x403a00 should help.
Andreas Mohr