Posts Tagged ‘undocumented’


October 21, 2015

Raymond Chen recently did a post about various functions that extracts a GUID from a string. He left out various pieces of information and I’m going to try to complete the picture.

Let’s start with UuidFromString. On Windows 95/98 UuidFromStringW is just a stub that returns RPC_S_CANNOT_SUPPORT. The minimum version information on MSDN is wrong in the usual way.

IID­From­String has already been covered so I’ll skip that.

Next up is CLSID­From­String. MSDN does of course not say anything about the ProgId handling but Raymond did talk about this part, I’ll just add that the implementation on Windows 8 checks if the string starts with a ‘{‘ and then tries to parse it as a GUID, otherwise it does a ProgId look-up pretty much like CLSIDFromProgID would do (I did not look at other Windows versions).

Now we’ll get to the real reason for this post. There are three more functions Raymond did not cover at all!

The first one is CLSIDFromStringWrap, exported by ordinal in SHLWAPI (version 5 and later). On Windows 8 it works like CLSID­From­String but on Windows 98/2000/XP (IE 5/6) it does not support ProgIds and works more like IID­From­String.

The second one is SHCLSIDFromString, exported by ordinal in SHELL32 (all versions) and by name in version 6 from XP.SP1 and later. MSDN fails to mention that it used to only be exported by ordinal and the version information is wrong. It works like IID­From­String except that the input string is a LPCTSTR (CHAR* on Windows 95/98 and WCHAR* on NT based systems).

The third one is RtlGUIDFromString in NTDLL (Windows 2000 and later). Because it takes a UNICODE_STRING it is mostly useful for kernel developers.

Our journey ends with GUIDFromString. This function is actually implemented in both SHELL32 (version 4.71 and later) and in SHLWAPI (version 5 and later). MSDN documents the ordinals but fails to document the minimum dll versions.


(Safe) SHAutoComplete

May 29, 2010

For a long time, MSDN has stated that SHAutoComplete can only be called once on a HWND, but a recent blog post by Raymond Chen “documents” that this issue was fixed in Vista.

It sure would be nice to avoid the leak on older platforms as well, but MS is not going to help you (Implementing such a thing would reveal that their Subclassing API that supposedly is XP+ only actually goes all the way back to Win98 (Really IE5 on Win95 / NT4))

Without knowing the internals of browseui.dll (Where most of the autocomplete stuff seems to be implemented) we are left with a ugly hack: (more…)