@@ -168,15 +168,14 @@ static void getUserShell(FFPlatform* platform)
168
168
ffStrbufReplaceAllC (& platform -> userShell , '\\' , '/' );
169
169
}
170
170
171
- static void detectWine ( FFstrbuf * buf )
171
+ static const char * detectWine ( void )
172
172
{
173
173
const char * __cdecl wine_get_version (void );
174
174
HMODULE hntdll = GetModuleHandleW (L"ntdll.dll" );
175
- if (!hntdll ) return ;
175
+ if (!hntdll ) return NULL ;
176
176
FF_LIBRARY_LOAD_SYMBOL_LAZY (hntdll , wine_get_version );
177
- if (!ffwine_get_version ) return ;
178
- ffStrbufAppendS (buf , buf -> length ? " - wine " : "wine " );
179
- ffStrbufAppendS (buf , ffwine_get_version ());
177
+ if (!ffwine_get_version ) return NULL ;
178
+ return ffwine_get_version ();
180
179
}
181
180
182
181
static void getSystemReleaseAndVersion (FFPlatformSysinfo * info )
@@ -199,29 +198,24 @@ static void getSystemReleaseAndVersion(FFPlatformSysinfo* info)
199
198
(unsigned ) osVersion .dwBuildNumber ,
200
199
(unsigned ) ubr );
201
200
202
- ffStrbufInit (& info -> displayVersion );
203
- if (!ffRegReadStrbuf (hKey , L"DisplayVersion" , & info -> displayVersion , NULL ))
204
- {
205
- if (osVersion .szCSDVersion [0 ])
206
- ffStrbufSetWS (& info -> displayVersion , osVersion .szCSDVersion );
207
- else
208
- ffRegReadStrbuf (hKey , L"ReleaseId" , & info -> displayVersion , NULL ); // For old Windows 10
209
- }
210
- detectWine (& info -> displayVersion );
211
-
212
201
ffRegReadStrbuf (hKey , L"BuildLabEx" , & info -> version , NULL );
213
202
214
- switch (osVersion .dwPlatformId )
203
+ const char * wineVersion = detectWine ();
204
+ if (wineVersion )
205
+ ffStrbufSetF (& info -> name , "Wine_%s" , wineVersion );
215
206
{
216
- case VER_PLATFORM_WIN32s :
217
- ffStrbufSetStatic (& info -> name , "WIN32s" );
218
- break ;
219
- case VER_PLATFORM_WIN32_WINDOWS :
220
- ffStrbufSetStatic (& info -> name , "WIN32_WINDOWS" );
221
- break ;
222
- case VER_PLATFORM_WIN32_NT :
223
- ffStrbufSetStatic (& info -> name , "WIN32_NT" );
224
- break ;
207
+ switch (osVersion .dwPlatformId )
208
+ {
209
+ case VER_PLATFORM_WIN32s :
210
+ ffStrbufSetStatic (& info -> name , "WIN32s" );
211
+ break ;
212
+ case VER_PLATFORM_WIN32_WINDOWS :
213
+ ffStrbufSetStatic (& info -> name , "WIN32_WINDOWS" );
214
+ break ;
215
+ case VER_PLATFORM_WIN32_NT :
216
+ ffStrbufSetStatic (& info -> name , "WIN32_NT" );
217
+ break ;
218
+ }
225
219
}
226
220
}
227
221
0 commit comments