mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-01 08:03:31 +01:00
Make compilation work on old MSVCs without GetVertsionEx magic. Patch from Frediano Ziglio.
svn:r6749
This commit is contained in:
parent
a7a1d4e3d3
commit
28a7c8a64c
@ -768,6 +768,7 @@ get_uname(void)
|
|||||||
{ 3, 51, "Windows NT 3.51" },
|
{ 3, 51, "Windows NT 3.51" },
|
||||||
{ -1, -1, NULL }
|
{ -1, -1, NULL }
|
||||||
};
|
};
|
||||||
|
#ifdef VER_SUITE_BACKOFFICE
|
||||||
static struct {
|
static struct {
|
||||||
unsigned int mask; const char *str;
|
unsigned int mask; const char *str;
|
||||||
} win_mask_table[] = {
|
} win_mask_table[] = {
|
||||||
@ -785,6 +786,7 @@ get_uname(void)
|
|||||||
{ VER_SUITE_TERMINAL, " {terminal services}" },
|
{ VER_SUITE_TERMINAL, " {terminal services}" },
|
||||||
{ 0, NULL },
|
{ 0, NULL },
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
memset(&info, 0, sizeof(info));
|
memset(&info, 0, sizeof(info));
|
||||||
info.dwOSVersionInfoSize = sizeof(info);
|
info.dwOSVersionInfoSize = sizeof(info);
|
||||||
if (! GetVersionEx((LPOSVERSIONINFO)&info)) {
|
if (! GetVersionEx((LPOSVERSIONINFO)&info)) {
|
||||||
@ -824,6 +826,7 @@ get_uname(void)
|
|||||||
(int)info.dwMajorVersion,(int)info.dwMinorVersion,
|
(int)info.dwMajorVersion,(int)info.dwMinorVersion,
|
||||||
info.szCSDVersion);
|
info.szCSDVersion);
|
||||||
}
|
}
|
||||||
|
#ifdef VER_SUITE_BACKOFFICE
|
||||||
if (info.wProductType == VER_NT_DOMAIN_CONTROLLER) {
|
if (info.wProductType == VER_NT_DOMAIN_CONTROLLER) {
|
||||||
strlcat(uname_result, " [domain controller]", sizeof(uname_result));
|
strlcat(uname_result, " [domain controller]", sizeof(uname_result));
|
||||||
} else if (info.wProductType == VER_NT_SERVER) {
|
} else if (info.wProductType == VER_NT_SERVER) {
|
||||||
@ -843,6 +846,7 @@ get_uname(void)
|
|||||||
tor_snprintf(uname_result+len, sizeof(uname_result)-len,
|
tor_snprintf(uname_result+len, sizeof(uname_result)-len,
|
||||||
" {0x%x}", info.wSuiteMask);
|
" {0x%x}", info.wSuiteMask);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
strlcpy(uname_result, "Unknown platform", sizeof(uname_result));
|
strlcpy(uname_result, "Unknown platform", sizeof(uname_result));
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user