Problem with ShellExecute and HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths

Dan Kegel dank at kegel.com
Sun Dec 29 01:41:56 CST 2002


I have a windows-free installation of current CVS wine,
with wordpad.exe and the needed DLLs pulled in from a Windows ME
installation.  wordpad works great.  However,
ShellExecute(... "wordpad.exe", ".\\stl\\readme.wri" ...) is failing to find wordpad.exe for me.
(The call in question is issued by the msvc4.0 setup.exe.
The current directory when I run this is /mnt/cdrom, and stl/readme.wri is
indeed there.)

To get some insight on how this is supposed to work,
I went to a real Windows Me system, searched the registry
for references to "wordpad.exe", and removed them, one by one,
testing after each deletion.  The reference that mattered was
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\WORDPAD.EXE]
@="C:\\Progra~1\\Access~1\\WORDPAD.EXE"

So I ran "regedit foo.reg" to import the above registry key, and
made sure it does show up in ~/.wine/system.reg.
Still didn't work.

I then ran wine --debugmsg +exec,+file,+reg setup.exe
to see whether Wine was properly searching that registry key.
Sure enough, Wine is trying to search that key, and it's not
finding it.  So... what's wrong?  Best I can figure is there's something
fishy about what registry file is being loaded.  Here are the interesting
bits of the log (word wrapped, unfortunately):

---------------------
...
trace:reg:NtQueryValueKey (0x24,L"LoadWindowsRegistryFiles",2,0xbfffe7fc,1024)
trace:reg:_w31_loadreg (void)
trace:file:FILE_DoOpenFile reg.dat OF_READ OF_SHARE_COMPAT
trace:file:FILE_DoOpenFile reg.dat 0000
trace:reg:NtOpenKey ((nil),L"Machine\\Software\\Microsoft\\Windows\\CurrentVersion\\App 
Paths",f003f,0xbfffbb08)
trace:reg:NtOpenKey <- (nil)
warn:file:FILE_DoOpenFile 'reg.dat' not found or sharing violation
warn:file:FILE_DoOpenFile (reg.dat): return = HFILE_ERROR error= 2
trace:reg:NtQueryValueKey (0x24,L"LoadGlobalRegistryFiles",2,0xbfffe7fc,1024)
trace:reg:NtQueryValueKey (0x24,L"GlobalRegistryDir",2,0xbfffe7fc,1024)
trace:reg:SHELL_LoadRegistry GlobalRegistryDir is '/usr/local/etc'.
warn:reg:_get_wine_registry_file_format_version Couldn't open /usr/local/etc/wine.userreg for 
reading: No such file or directory
warn:reg:_get_wine_registry_file_format_version Couldn't open /usr/local/etc/wine.systemreg for 
reading: No such file or directory
... [snip] ...
trace:exec:ShellExecuteA
trace:exec:ShellExecuteExA32 mask=0x00000000 hwnd=0x10023 verb=(null) file="wordpad.exe" 
parm=".\\stl\\readme.wri" dir="." show=0x00000001 class=not used
trace:exec:ShellExecuteExA32 execute:'wordpad.exe','.\stl\readme.wri'
trace:exec:SHELL_ExecuteA Execute wordpad.exe .\stl\readme.wri from directory .
trace:reg:NtOpenKey ((nil),L"Machine\\Software\\Microsoft\\Windows\\CurrentVersion\\App 
Paths",f003f,0x4078ebcc)
trace:reg:NtOpenKey <- (nil)
trace:reg:NtOpenKey ((nil),L"Machine\\Software\\Wine\\Wine\\Config\\AppDefaults",f003f,0x40790040)
trace:reg:NtOpenKey <- (nil)
trace:reg:NtQueryValueKey (0x14,L"wordpad.exe",2,0x40790134,80)
trace:reg:NtQueryValueKey (0x14,L"*wordpad.exe",2,0x40790134,80)
trace:reg:NtQueryValueKey (0x14,L"*",2,0x40790134,80)
trace:file:CreateFileW L"C:\\WINDOWS\\SYSTEM\\wordpad.exe" GENERIC_READ FILE_SHARE_READ 
OPEN_EXISTING  attributes 0x0
warn:file:CreateFileW Unable to get full filename from L"C:\\WINDOWS\\SYSTEM\\wordpad.exe" (GLE 2)
trace:exec:SHELL_FindExecutable wordpad.exe
trace:exec:SHELL_FindExecutable xlpFile=,extension=(null)
warn:exec:SHELL_FindExecutable Returning 31 - No association
trace:exec:ShellExecuteA
trace:exec:ShellExecuteExA32 mask=0x00000000 hwnd=0x10023 verb=(null) file=".wordpad.exe" 
parm=".\\stl\\readme.wri" dir="." show=0x00000001 class=not used
trace:exec:ShellExecuteExA32 execute:'.wordpad.exe','.\stl\readme.wri'
trace:exec:SHELL_ExecuteA Execute .wordpad.exe .\stl\readme.wri from directory .
trace:reg:NtOpenKey ((nil),L"Machine\\Software\\Microsoft\\Windows\\CurrentVersion\\App 
Paths",f003f,0x4078ebcc)
trace:reg:NtOpenKey <- (nil)
trace:reg:NtOpenKey ((nil),L"Machine\\Software\\Wine\\Wine\\Config\\AppDefaults",f003f,0x40790040)
trace:reg:NtOpenKey <- (nil)
trace:reg:NtQueryValueKey (0x14,L".wordpad.exe",2,0x40790134,80)
trace:reg:NtQueryValueKey (0x14,L"*.wordpad.exe",2,0x40790134,80)
trace:reg:NtQueryValueKey (0x14,L"*",2,0x40790134,80)
trace:file:CreateFileW L"C:\\WINDOWS\\SYSTEM\\.wordpad.exe" GENERIC_READ FILE_SHARE_READ 
OPEN_EXISTING  attributes 0x0
warn:file:CreateFileW Unable to get full filename from L"C:\\WINDOWS\\SYSTEM\\.wordpad.exe" (GLE 2)
trace:exec:SHELL_FindExecutable .wordpad.exe
trace:exec:SHELL_FindExecutable xlpFile=,extension=(null)
warn:exec:SHELL_FindExecutable Returning 31 - No association
trace:file:GetFileInformationByHandle 0xffffffff
---------------------

OK, so then I copied my system.reg to /usr/local/etc/wine.systemreg.
Now it finds that key (!) but unfortunately, the only change is that
the line
warn:reg:_get_wine_registry_file_format_version Couldn't open /usr/local/etc/wine.systemreg for 
reading: No such file or directory
no longer shows up in the log.

I'm pretty sure this is supposed to work, but I'm having trouble untangling it.
Help would be greatly appreciated.

If anyone's interested, I can send an executable that does the ShellExecute
call in question so they can reproduce it themselves...

Thanks,
Dan

-- 
Dan Kegel
Linux User #78045
http://www.kegel.com




More information about the wine-devel mailing list