Any suggestions as to how to discover the prototype of the apparently undocumented function syssetup.dll.SetupQueryRegisteredOsComponent ? It seems to be needed to install mdac-2.8. ( http://bugs.winehq.org/show_bug.cgi?id=5824 ) - Dan
"Dan Kegel" dank@kegel.com wrote:
Any suggestions as to how to discover the prototype of the apparently undocumented function syssetup.dll.SetupQueryRegisteredOsComponent ?
Perhaps installing native MSI and running with +relay,+snoop may shed some light, be prepared to decipher amount and the meaning of arguments by looking a the function args dumped by +snoop.
It's something like
BOOL SetupQueryRegisteredOsComponent(IN const IID *const pIid, IN OUT LPVOID component_data, IN OUT LPVOID exception_data, DWORD reserved1, DWORD reserved2);
component_data structure max length is 0xDC, exception_data's is 0x454; first argument of both is structure size. I wonder if they defined in setupapi.h already.
Dan Kegel wrote:
Any suggestions as to how to discover the prototype of the apparently undocumented function syssetup.dll.SetupQueryRegisteredOsComponent ? It seems to be needed to install mdac-2.8. ( http://bugs.winehq.org/show_bug.cgi?id=5824 )
- Dan
Dan Kegel [mailto:dank@kegel.com] wrote:
Any suggestions as to how to discover the prototype of the apparently undocumented function syssetup.dll.SetupQueryRegisteredOsComponent ? It seems to be needed to install mdac-2.8. ( http://bugs.winehq.org/show_bug.cgi?id=5824 )
Well, on the web it does not seem to say anything about that function. So that leaves only reverse engineering. Which means someone would have to dig into it and try to come up with a prototype and possibly some explanation about the parameters and someone else would have to find what can be done.
From a quick check it seems to take three parameters, with the first being
a CLSID or other GUID and the other two being DWORDs. The second parameter is checked to be higher than 0 and smaller or equal to 0xDC and the third parameter is checked to be higher than 0 and smaller or equal to 0x454. (This is XP SP2 fully patched). When any of the three parameters are 0, the function sets last error to 0x57 and returns with 0. When the second and third parameter is above the limits the function sets last error to 0x0D and returns with 0. When everything was successful the function returns with 1.
And the function starts with opening for read access HKLM\Software\Microsoft\Windows\CurrentVersion\Setup\ExceptionComponents then opens the subkey inside that key from the stringified CLSID. For any registry error the last error is set to the registry function return value and the function itself returns 0. After that things get hairy and seem to be related to functions like SetupEnumerateRegisterdOsComponents() and SetupQueryRegisteredOsComponentsOrder() too.
As it seems this is a function that requires magic numbers as parameters and for that reason I'm quite sure that a real implementation is basically impossible without disassembling most of syssetup. Maybe that a stub implementation is enough to get MDAC setup to work.
Rolf Kalbermatter
"Rolf Kalbermatter" r.kalbermatter@hccnet.nl wrote:
From a quick check it seems to take three parameters, with the first being
a CLSID or other GUID and the other two being DWORDs. The second parameter is checked to be higher than 0 and smaller or equal to 0xDC and the third parameter is checked to be higher than 0 and smaller or equal to 0x454. (This is XP SP2 fully patched). When any of the three parameters are 0, the function sets last error to 0x57 and returns with 0. When the second and third parameter is above the limits the function sets last error to 0x0D and returns with 0. When everything was successful the function returns with 1.
This appears to be a correct description, at least attached test shows exactly the same behaviour as described above. If I add 2 more parameters as Andrey suggested I get a crash due to stack corruption.
This information should be enough to create a stub.
On 3/24/07, Dmitry Timoshkov dmitry@codeweavers.com wrote:
This information should be enough to create a stub.
I'll try it soon. Annoyingly, now mdac-2.7 is failing install because of the same missing function. (Or I'm smoking crack...)