File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -522,8 +522,20 @@ cupsSetUserAgent(const char *user_agent)/* I - User-Agent string or `NULL` */
522522 * Gather Windows version information for the User-Agent string...
523523 */
524524
525- version .dwOSVersionInfoSize = sizeof (OSVERSIONINFO );
526- GetVersionExA (& version );
525+ typedef LONG NTSTATUS , * PNTSTATUS ;
526+ typedef NTSTATUS (WINAPI * RtlGetVersionPtr )(PRTL_OSVERSIONINFOW );
527+
528+ RtlGetVersionPtr RtlGetVersionInternal = (RtlGetVersionPtr )GetProcAddress (GetModuleHandleW (L"ntdll.dll" ), "RtlGetVersion" );
529+ if (RtlGetVersionInternal )
530+ {
531+ version .dwOSVersionInfoSize = sizeof (OSVERSIONINFO );
532+ RtlGetVersionInternal ((PRTL_OSVERSIONINFOW )& version );
533+ }
534+ else
535+ {
536+ ZeroMemory (& version , sizeof (version ));
537+ }
538+
527539 GetNativeSystemInfo (& sysinfo );
528540
529541 switch (sysinfo .wProcessorArchitecture )
You can’t perform that action at this time.
0 commit comments