Skip to content

Commit 8752bda

Browse files
authored
Merge pull request #45 from Microsoft/issue44
Add support for Windows XP
2 parents 12c8f71 + fade9cc commit 8752bda

File tree

8 files changed

+17
-13
lines changed

8 files changed

+17
-13
lines changed

src/vswhere.lib/Formatter.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,28 +104,28 @@ wstring Formatter::FormatDate(_In_ const FILETIME& value)
104104
}
105105

106106
// Format date
107-
auto cch = ::GetDateFormatEx(LOCALE_NAME_USER_DEFAULT, DATE_SHORTDATE, &st, NULL, NULL, 0, NULL);
107+
auto cch = ::GetDateFormatW(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &st, NULL, NULL, 0);
108108
if (!cch)
109109
{
110110
throw win32_error();
111111
}
112112

113113
date.resize(cch - 1);
114-
cch = ::GetDateFormatEx(LOCALE_NAME_USER_DEFAULT, DATE_SHORTDATE, &st, NULL, const_cast<LPWSTR>(date.c_str()), cch, NULL);
114+
cch = ::GetDateFormatW(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &st, NULL, const_cast<LPWSTR>(date.c_str()), cch);
115115
if (!cch)
116116
{
117117
throw win32_error();
118118
}
119119

120120
// Format time
121-
cch = ::GetTimeFormatEx(LOCALE_NAME_USER_DEFAULT, 0, &st, NULL, NULL, 0);
121+
cch = ::GetTimeFormatW(LOCALE_USER_DEFAULT, 0, &st, NULL, NULL, 0);
122122
if (!cch)
123123
{
124124
throw win32_error();
125125
}
126126

127127
time.reserve(cch - 1);
128-
cch = ::GetTimeFormatEx(LOCALE_NAME_USER_DEFAULT, 0, &st, NULL, const_cast<LPWSTR>(time.c_str()), cch);
128+
cch = ::GetTimeFormatW(LOCALE_USER_DEFAULT, 0, &st, NULL, const_cast<LPWSTR>(time.c_str()), cch);
129129
if (!cch)
130130
{
131131
throw win32_error();

src/vswhere.lib/stdafx.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99

1010
#define WIN32_LEAN_AND_MEAN
1111

12+
#ifndef MAXUINT
13+
#define MAXUINT 0xffff
14+
#endif
15+
1216
// Windows headers
1317
#include <windows.h>
1418
#include <fcntl.h>

src/vswhere.lib/targetver.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
#undef _WIN32_WINNT
1212
#endif
1313

14-
#define _WIN32_WINNT 0x0601
14+
#define _WIN32_WINNT 0x0501
1515

1616
#include <sdkddkver.h>

src/vswhere.lib/vswhere.lib.vcxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@
2929
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
3030
<ConfigurationType>StaticLibrary</ConfigurationType>
3131
<UseDebugLibraries>true</UseDebugLibraries>
32-
<PlatformToolset>v140</PlatformToolset>
32+
<PlatformToolset>v140_xp</PlatformToolset>
3333
<CharacterSet>Unicode</CharacterSet>
3434
</PropertyGroup>
3535
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
3636
<ConfigurationType>StaticLibrary</ConfigurationType>
3737
<UseDebugLibraries>false</UseDebugLibraries>
38-
<PlatformToolset>v140</PlatformToolset>
38+
<PlatformToolset>v140_xp</PlatformToolset>
3939
<WholeProgramOptimization>true</WholeProgramOptimization>
4040
<CharacterSet>Unicode</CharacterSet>
4141
</PropertyGroup>

src/vswhere/targetver.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
#undef _WIN32_WINNT
1212
#endif
1313

14-
#define _WIN32_WINNT 0x0601
14+
#define _WIN32_WINNT 0x0501
1515

1616
#include <sdkddkver.h>

src/vswhere/vswhere.vcxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
2222
<ConfigurationType>Application</ConfigurationType>
2323
<UseDebugLibraries>true</UseDebugLibraries>
24-
<PlatformToolset>v140</PlatformToolset>
24+
<PlatformToolset>v140_xp</PlatformToolset>
2525
<CharacterSet>Unicode</CharacterSet>
2626
</PropertyGroup>
2727
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
2828
<ConfigurationType>Application</ConfigurationType>
2929
<UseDebugLibraries>false</UseDebugLibraries>
30-
<PlatformToolset>v140</PlatformToolset>
30+
<PlatformToolset>v140_xp</PlatformToolset>
3131
<WholeProgramOptimization>true</WholeProgramOptimization>
3232
<CharacterSet>Unicode</CharacterSet>
3333
</PropertyGroup>

test/vswhere.test/targetver.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
#undef _WIN32_WINNT
1212
#endif
1313

14-
#define _WIN32_WINNT 0x0601
14+
#define _WIN32_WINNT 0x0501
1515

1616
#include <sdkddkver.h>

test/vswhere.test/vswhere.test.vcxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@
2121
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
2222
<ConfigurationType>DynamicLibrary</ConfigurationType>
2323
<UseDebugLibraries>true</UseDebugLibraries>
24-
<PlatformToolset>v140</PlatformToolset>
24+
<PlatformToolset>v140_xp</PlatformToolset>
2525
<CharacterSet>Unicode</CharacterSet>
2626
<UseOfMfc>false</UseOfMfc>
2727
</PropertyGroup>
2828
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
2929
<ConfigurationType>DynamicLibrary</ConfigurationType>
3030
<UseDebugLibraries>false</UseDebugLibraries>
31-
<PlatformToolset>v140</PlatformToolset>
31+
<PlatformToolset>v140_xp</PlatformToolset>
3232
<WholeProgramOptimization>true</WholeProgramOptimization>
3333
<CharacterSet>Unicode</CharacterSet>
3434
<UseOfMfc>false</UseOfMfc>

0 commit comments

Comments
 (0)