Skip to content

Commit e71293b

Browse files
committed
Fix new Windows branding logic for 32-bit builds.
1 parent ff6cc5d commit e71293b

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

w32util.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2105,18 +2105,20 @@ DLL_EXPORT void w32_init_hostinfo( HOST_INFO* pHostInfo )
21052105

21062106
if (hMod)
21072107
{
2108-
typedef PWSTR (*BFSPROC)( PCWSTR );
2109-
2110-
BFSPROC pfnBrandingFormatString =
2111-
(BFSPROC) GetProcAddress( hMod, "BrandingFormatString" );
2108+
FARPROC pfnBrandingFormatString =
2109+
GetProcAddress( hMod, "BrandingFormatString" );
21122110

21132111
if (pfnBrandingFormatString)
21142112
{
21152113
// BrandingFormatString's format codes are undocumented. The
21162114
// only place I could find them anywhere was on this web page:
21172115
// https://dennisbabkin.com/blog/?t=how-to-tell-the-real-version-of-windows-your-app-is-running-on
21182116

2119-
PWSTR pwstrOSName = pfnBrandingFormatString( L"%WINDOWS_LONG%" );
2117+
// The "BrandingFormatString" function always takes a WIDE string
2118+
// argument and always returns a WIDE string result too, for BOTH
2119+
// the 32-bit and 64-bit versions of windbrand.dll.
2120+
2121+
PWSTR pwstrOSName = (PWSTR) pfnBrandingFormatString( L"%WINDOWS_LONG%" );
21202122

21212123
if (pwstrOSName)
21222124
{

0 commit comments

Comments
 (0)