https://bugs.winehq.org/show_bug.cgi?id=48993
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch Summary|64-bit Powershell 2.0 for |64-bit Windows Management |Windows 2003 installer |Framework 2.0 for Windows |fails due to missing |2003 installer fails with |'scecli.dll' |error 'Invalid handle' | |(needs | |'scecli.SceConfigureSystem' | |stub)
--- Comment #3 from Anastasius Focht focht@gmx.net --- Hello Leith,
thanks for the patch. I'm refining the summary to highlight it's that one stub function needed which implies the addition of the stub dll as well.
--- quote --- Is there a way to verify the number of arguments on the stack expected by SceConfigureSystem? --- quote ---
There are a few techniques if you don't know the prototype when no documentation/SDK headers exist. All of that requires that the general rules of the Wine project w.r.t. reverse engineering are obeyed.
1) Analyse the caller of the API function (= application) and check how the stack is set up. Most of the time the number and type of arguments can be deduced fairly easily. This technique should only be used if the caller itself is not subject to reverse engineering restrictions (not part of OS)
2) Write a test case that does argument fuzzing, i.e. calls the unknown API function with varying number of arguments. You start with one argument (DWORD type) and check for stack imbalance (STDCALL).
--- quote --- Similarly is there a way to know if the remaining arguments should be treated as pointers, or as integers? --- quote ---
After figuring the out the number of arguments you take a look at the value range. Specific types (pointers, handle, enums) have distinct ranges. For example if you see a value that matches the return/out value of preceding win32 API calls, i.e. CreateFile(), HeapAlloc(), MultiByteToWideChar() you can deduce the type and purpose of parameters this way. For structure layout/unknown members it's more complicated. You use "magic" patterns to figure out which fields/offsets have been written to and interpret the value ranges again.
I wouldn't bother too much here since only a stub is needed. If you look at Wine source, there are multiple places where stubs exist where only the number of arguments are known, gathered by above mentioned techniques.
--- snip --- $ egrep -Hrni "(unk1|unknown1)" --- snip ---
Regards