Skip to content

Commit b9d7ec5

Browse files
authored
Merge branch 'master' into user/dmachaj/no-loadlibrary
2 parents db7693b + 4c9e03f commit b9d7ec5

File tree

80 files changed

+514
-65
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+514
-65
lines changed

Directory.Build.Props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
<ItemDefinitionGroup>
5050
<ClCompile>
5151
<WarningLevel>Level4</WarningLevel>
52+
<TreatWarningAsError>true</TreatWarningAsError>
5253
<SDLCheck>true</SDLCheck>
5354
<ConformanceMode>true</ConformanceMode>
5455
<LanguageStandard Condition="'$(CppWinRTLanguageStandard)'==''">stdcpp17</LanguageStandard>

Directory.Packages.props

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<Project>
2+
<PropertyGroup>
3+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
4+
</PropertyGroup>
5+
<ItemGroup>
6+
<PackageVersion Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="5.4.7" />
7+
<PackageVersion Include="Microsoft.VisualStudio.SDK" Version="17.3.32804.24" />
8+
<PackageVersion Include="Microsoft.VSSDK.BuildTools" Version="17.3.2093" />
9+
<PackageVersion Include="Newtonsoft.Json" Version="13.0.1" />
10+
<PackageVersion Include="System.Text.Json" Version="6.0.10" />
11+
</ItemGroup>
12+
</Project>

cppwinrt/code_writers.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ namespace cppwinrt
763763
{
764764
auto format = R"( template <> struct abi<%>
765765
{
766-
struct WINRT_IMPL_NOVTABLE type : inspectable_abi
766+
struct WINRT_IMPL_ABI_DECL type : inspectable_abi
767767
{
768768
)";
769769

@@ -773,7 +773,7 @@ namespace cppwinrt
773773
{
774774
auto format = R"( template <%> struct abi<%>
775775
{
776-
struct WINRT_IMPL_NOVTABLE type : inspectable_abi
776+
struct WINRT_IMPL_ABI_DECL type : inspectable_abi
777777
{
778778
)";
779779

@@ -814,7 +814,7 @@ namespace cppwinrt
814814
{
815815
auto format = R"( template <%> struct abi<%>
816816
{
817-
struct WINRT_IMPL_NOVTABLE type : unknown_abi
817+
struct WINRT_IMPL_ABI_DECL type : unknown_abi
818818
{
819819
virtual int32_t __stdcall Invoke(%) noexcept = 0;
820820
};
@@ -1868,7 +1868,7 @@ namespace cppwinrt
18681868
{
18691869
auto param_name = param.Name();
18701870

1871-
w.write("\n if (%) *% = detach_abi(winrt_impl_%);", param_name, param_name, param_name);
1871+
w.write("\n if (%) *% = detach_abi(winrt_impl_%);", param_name, param_name, param_name);
18721872
}
18731873
}
18741874
}

cppwinrt/component_writers.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@ catch (...) { return winrt::to_hresult(); }
754754
using implements_type = typename %_base::implements_type;
755755
using implements_type::implements_type;
756756
%%
757-
hstring GetRuntimeClassName() const
757+
hstring GetRuntimeClassName() const override
758758
{
759759
return L"%.%";
760760
}

cppwinrt/cppwinrt.vcxproj

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,8 @@
176176
<Optimization>Disabled</Optimization>
177177
<AdditionalIncludeDirectories>..\inc;$(OutputPath);$(WinMDPackageDir);</AdditionalIncludeDirectories>
178178
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
179+
<WarningLevel>Level4</WarningLevel>
180+
<TreatWarningAsError>true</TreatWarningAsError>
179181
</ClCompile>
180182
<Link>
181183
<SubSystem>Console</SubSystem>
@@ -193,6 +195,8 @@
193195
<Optimization>Disabled</Optimization>
194196
<AdditionalIncludeDirectories>..\inc;$(OutputPath);$(WinMDPackageDir);</AdditionalIncludeDirectories>
195197
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
198+
<WarningLevel>Level4</WarningLevel>
199+
<TreatWarningAsError>true</TreatWarningAsError>
196200
</ClCompile>
197201
<Link>
198202
<SubSystem>Console</SubSystem>
@@ -210,6 +214,8 @@
210214
<Optimization>Disabled</Optimization>
211215
<AdditionalIncludeDirectories>..\inc;$(OutputPath);$(WinMDPackageDir);</AdditionalIncludeDirectories>
212216
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
217+
<WarningLevel>Level4</WarningLevel>
218+
<TreatWarningAsError>true</TreatWarningAsError>
213219
</ClCompile>
214220
<Link>
215221
<SubSystem>Console</SubSystem>
@@ -230,6 +236,8 @@
230236
<AdditionalIncludeDirectories>..\inc;$(OutputPath);$(WinMDPackageDir);</AdditionalIncludeDirectories>
231237
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
232238
<ControlFlowGuard>Guard</ControlFlowGuard>
239+
<WarningLevel>Level4</WarningLevel>
240+
<TreatWarningAsError>true</TreatWarningAsError>
233241
</ClCompile>
234242
<Link>
235243
<SubSystem>Console</SubSystem>
@@ -253,6 +261,8 @@
253261
<AdditionalIncludeDirectories>..\inc;$(OutputPath);$(WinMDPackageDir);</AdditionalIncludeDirectories>
254262
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
255263
<ControlFlowGuard>Guard</ControlFlowGuard>
264+
<WarningLevel>Level4</WarningLevel>
265+
<TreatWarningAsError>true</TreatWarningAsError>
256266
</ClCompile>
257267
<Link>
258268
<SubSystem>Console</SubSystem>
@@ -276,6 +286,8 @@
276286
<AdditionalIncludeDirectories>..\inc;$(OutputPath);$(WinMDPackageDir);</AdditionalIncludeDirectories>
277287
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
278288
<ControlFlowGuard>Guard</ControlFlowGuard>
289+
<WarningLevel>Level4</WarningLevel>
290+
<TreatWarningAsError>true</TreatWarningAsError>
279291
</ClCompile>
280292
<Link>
281293
<SubSystem>Console</SubSystem>

natvis/cppwinrtvisualizer.vcxproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@
103103
<ClCompile>
104104
<PrecompiledHeader>Use</PrecompiledHeader>
105105
<WarningLevel>Level4</WarningLevel>
106+
<TreatWarningAsError>true</TreatWarningAsError>
106107
<Optimization>Disabled</Optimization>
107108
<PreprocessorDefinitions>VSDEBUGENG_USE_CPP11_SCOPED_ENUMS;WIN32;_DEBUG;VISUALIZER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
108109
<AdditionalIncludeDirectories>$(IntDir);..\cppwinrt;..\strings;$(DIASDKInc);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@@ -127,6 +128,7 @@
127128
<ClCompile>
128129
<PrecompiledHeader>Use</PrecompiledHeader>
129130
<WarningLevel>Level4</WarningLevel>
131+
<TreatWarningAsError>true</TreatWarningAsError>
130132
<Optimization>Disabled</Optimization>
131133
<PreprocessorDefinitions>VSDEBUGENG_USE_CPP11_SCOPED_ENUMS;_DEBUG;VISUALIZER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
132134
<AdditionalIncludeDirectories>$(IntDir);..\cppwinrt;..\strings;$(DIASDKInc);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@@ -150,6 +152,7 @@
150152
<ClCompile>
151153
<PrecompiledHeader>Use</PrecompiledHeader>
152154
<WarningLevel>Level4</WarningLevel>
155+
<TreatWarningAsError>true</TreatWarningAsError>
153156
<Optimization>Disabled</Optimization>
154157
<PreprocessorDefinitions>VSDEBUGENG_USE_CPP11_SCOPED_ENUMS;_DEBUG;VISUALIZER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
155158
<AdditionalIncludeDirectories>$(IntDir);..\cppwinrt;..\strings;$(DIASDKInc);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@@ -173,6 +176,7 @@
173176
<ClCompile>
174177
<PrecompiledHeader>Use</PrecompiledHeader>
175178
<WarningLevel>Level4</WarningLevel>
179+
<TreatWarningAsError>true</TreatWarningAsError>
176180
<Optimization>MaxSpeed</Optimization>
177181
<FunctionLevelLinking>true</FunctionLevelLinking>
178182
<IntrinsicFunctions>true</IntrinsicFunctions>
@@ -202,6 +206,7 @@
202206
<ClCompile>
203207
<PrecompiledHeader>Use</PrecompiledHeader>
204208
<WarningLevel>Level4</WarningLevel>
209+
<TreatWarningAsError>true</TreatWarningAsError>
205210
<Optimization>MaxSpeed</Optimization>
206211
<FunctionLevelLinking>true</FunctionLevelLinking>
207212
<IntrinsicFunctions>true</IntrinsicFunctions>
@@ -231,6 +236,7 @@
231236
<ClCompile>
232237
<PrecompiledHeader>Use</PrecompiledHeader>
233238
<WarningLevel>Level4</WarningLevel>
239+
<TreatWarningAsError>true</TreatWarningAsError>
234240
<Optimization>MaxSpeed</Optimization>
235241
<FunctionLevelLinking>true</FunctionLevelLinking>
236242
<IntrinsicFunctions>true</IntrinsicFunctions>

prebuild/prebuild.vcxproj

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@
8888
<Optimization>Disabled</Optimization>
8989
<AdditionalIncludeDirectories>..\cppwinrt</AdditionalIncludeDirectories>
9090
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
91+
<WarningLevel>Level4</WarningLevel>
92+
<TreatWarningAsError>true</TreatWarningAsError>
9193
</ClCompile>
9294
<Link>
9395
<SubSystem>Console</SubSystem>
@@ -98,6 +100,8 @@
98100
<Optimization>Disabled</Optimization>
99101
<AdditionalIncludeDirectories>..\cppwinrt</AdditionalIncludeDirectories>
100102
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
103+
<WarningLevel>Level4</WarningLevel>
104+
<TreatWarningAsError>true</TreatWarningAsError>
101105
</ClCompile>
102106
<Link>
103107
<SubSystem>Console</SubSystem>
@@ -108,6 +112,8 @@
108112
<Optimization>Disabled</Optimization>
109113
<AdditionalIncludeDirectories>..\cppwinrt</AdditionalIncludeDirectories>
110114
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
115+
<WarningLevel>Level4</WarningLevel>
116+
<TreatWarningAsError>true</TreatWarningAsError>
111117
</ClCompile>
112118
<Link>
113119
<SubSystem>Console</SubSystem>
@@ -121,6 +127,8 @@
121127
<AdditionalIncludeDirectories>..\cppwinrt</AdditionalIncludeDirectories>
122128
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
123129
<ControlFlowGuard>Guard</ControlFlowGuard>
130+
<WarningLevel>Level4</WarningLevel>
131+
<TreatWarningAsError>true</TreatWarningAsError>
124132
</ClCompile>
125133
<Link>
126134
<SubSystem>Console</SubSystem>
@@ -136,6 +144,8 @@
136144
<AdditionalIncludeDirectories>..\cppwinrt</AdditionalIncludeDirectories>
137145
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
138146
<ControlFlowGuard>Guard</ControlFlowGuard>
147+
<WarningLevel>Level4</WarningLevel>
148+
<TreatWarningAsError>true</TreatWarningAsError>
139149
</ClCompile>
140150
<Link>
141151
<SubSystem>Console</SubSystem>
@@ -151,6 +161,8 @@
151161
<AdditionalIncludeDirectories>..\cppwinrt</AdditionalIncludeDirectories>
152162
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
153163
<ControlFlowGuard>Guard</ControlFlowGuard>
164+
<WarningLevel>Level4</WarningLevel>
165+
<TreatWarningAsError>true</TreatWarningAsError>
154166
</ClCompile>
155167
<Link>
156168
<SubSystem>Console</SubSystem>

scratch/scratch.vcxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@
5353
<ItemDefinitionGroup>
5454
<ClCompile>
5555
<AdditionalIncludeDirectories>$(OutputPath);Generated Files;</AdditionalIncludeDirectories>
56+
<WarningLevel>Level4</WarningLevel>
57+
<TreatWarningAsError>true</TreatWarningAsError>
5658
</ClCompile>
5759
<Link>
5860
<SubSystem>Console</SubSystem>

strings/base_abi.h

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ namespace winrt::impl
33
{
44
template <> struct abi<Windows::Foundation::IUnknown>
55
{
6-
struct WINRT_IMPL_NOVTABLE type
6+
struct WINRT_IMPL_ABI_DECL type
77
{
88
virtual int32_t __stdcall QueryInterface(guid const& id, void** object) noexcept = 0;
99
virtual uint32_t __stdcall AddRef() noexcept = 0;
@@ -15,7 +15,7 @@ namespace winrt::impl
1515

1616
template <> struct abi<Windows::Foundation::IInspectable>
1717
{
18-
struct WINRT_IMPL_NOVTABLE type : unknown_abi
18+
struct WINRT_IMPL_ABI_DECL type : unknown_abi
1919
{
2020
virtual int32_t __stdcall GetIids(uint32_t* count, guid** ids) noexcept = 0;
2121
virtual int32_t __stdcall GetRuntimeClassName(void** name) noexcept = 0;
@@ -27,20 +27,20 @@ namespace winrt::impl
2727

2828
template <> struct abi<Windows::Foundation::IActivationFactory>
2929
{
30-
struct WINRT_IMPL_NOVTABLE type : inspectable_abi
30+
struct WINRT_IMPL_ABI_DECL type : inspectable_abi
3131
{
3232
virtual int32_t __stdcall ActivateInstance(void** instance) noexcept = 0;
3333
};
3434
};
3535

36-
struct WINRT_IMPL_NOVTABLE IAgileObject : unknown_abi {};
36+
struct WINRT_IMPL_ABI_DECL IAgileObject : unknown_abi {};
3737

38-
struct WINRT_IMPL_NOVTABLE IAgileReference : unknown_abi
38+
struct WINRT_IMPL_ABI_DECL IAgileReference : unknown_abi
3939
{
4040
virtual int32_t __stdcall Resolve(guid const& id, void** object) noexcept = 0;
4141
};
4242

43-
struct WINRT_IMPL_NOVTABLE IMarshal : unknown_abi
43+
struct WINRT_IMPL_ABI_DECL IMarshal : unknown_abi
4444
{
4545
virtual int32_t __stdcall GetUnmarshalClass(guid const& riid, void* pv, uint32_t dwDestContext, void* pvDestContext, uint32_t mshlflags, guid* pCid) noexcept = 0;
4646
virtual int32_t __stdcall GetMarshalSizeMax(guid const& riid, void* pv, uint32_t dwDestContext, void* pvDestContext, uint32_t mshlflags, uint32_t* pSize) noexcept = 0;
@@ -50,20 +50,20 @@ namespace winrt::impl
5050
virtual int32_t __stdcall DisconnectObject(uint32_t dwReserved) noexcept = 0;
5151
};
5252

53-
struct WINRT_IMPL_NOVTABLE IGlobalInterfaceTable : unknown_abi
53+
struct WINRT_IMPL_ABI_DECL IGlobalInterfaceTable : unknown_abi
5454
{
5555
virtual int32_t __stdcall RegisterInterfaceInGlobal(void* object, guid const& iid, uint32_t* cookie) noexcept = 0;
5656
virtual int32_t __stdcall RevokeInterfaceFromGlobal(uint32_t cookie) noexcept = 0;
5757
virtual int32_t __stdcall GetInterfaceFromGlobal(uint32_t cookie, guid const& iid, void** object) noexcept = 0;
5858
};
5959

60-
struct WINRT_IMPL_NOVTABLE IStaticLifetime : inspectable_abi
60+
struct WINRT_IMPL_ABI_DECL IStaticLifetime : inspectable_abi
6161
{
6262
virtual int32_t __stdcall unused() noexcept = 0;
6363
virtual int32_t __stdcall GetCollection(void** value) noexcept = 0;
6464
};
6565

66-
struct WINRT_IMPL_NOVTABLE IStaticLifetimeCollection : inspectable_abi
66+
struct WINRT_IMPL_ABI_DECL IStaticLifetimeCollection : inspectable_abi
6767
{
6868
virtual int32_t __stdcall Lookup(void*, void**) noexcept = 0;
6969
virtual int32_t __stdcall unused() noexcept = 0;
@@ -74,23 +74,23 @@ namespace winrt::impl
7474
virtual int32_t __stdcall unused4() noexcept = 0;
7575
};
7676

77-
struct WINRT_IMPL_NOVTABLE IWeakReference : unknown_abi
77+
struct WINRT_IMPL_ABI_DECL IWeakReference : unknown_abi
7878
{
7979
virtual int32_t __stdcall Resolve(guid const& iid, void** objectReference) noexcept = 0;
8080
};
8181

82-
struct WINRT_IMPL_NOVTABLE IWeakReferenceSource : unknown_abi
82+
struct WINRT_IMPL_ABI_DECL IWeakReferenceSource : unknown_abi
8383
{
8484
virtual int32_t __stdcall GetWeakReference(IWeakReference** weakReference) noexcept = 0;
8585
};
8686

87-
struct WINRT_IMPL_NOVTABLE IRestrictedErrorInfo : unknown_abi
87+
struct WINRT_IMPL_ABI_DECL IRestrictedErrorInfo : unknown_abi
8888
{
8989
virtual int32_t __stdcall GetErrorDetails(bstr* description, int32_t* error, bstr* restrictedDescription, bstr* capabilitySid) noexcept = 0;
9090
virtual int32_t __stdcall GetReference(bstr* reference) noexcept = 0;
9191
};
9292

93-
struct WINRT_IMPL_NOVTABLE IErrorInfo : unknown_abi
93+
struct WINRT_IMPL_ABI_DECL IErrorInfo : unknown_abi
9494
{
9595
virtual int32_t __stdcall GetGUID(guid* value) noexcept = 0;
9696
virtual int32_t __stdcall GetSource(bstr* value) noexcept = 0;
@@ -99,7 +99,7 @@ namespace winrt::impl
9999
virtual int32_t __stdcall GetHelpContext(uint32_t* value) noexcept = 0;
100100
};
101101

102-
struct WINRT_IMPL_NOVTABLE ILanguageExceptionErrorInfo2 : unknown_abi
102+
struct WINRT_IMPL_ABI_DECL ILanguageExceptionErrorInfo2 : unknown_abi
103103
{
104104
virtual int32_t __stdcall GetLanguageException(void** exception) noexcept = 0;
105105
virtual int32_t __stdcall GetPreviousLanguageExceptionErrorInfo(ILanguageExceptionErrorInfo2** previous) noexcept = 0;
@@ -109,25 +109,25 @@ namespace winrt::impl
109109

110110
struct ICallbackWithNoReentrancyToApplicationSTA;
111111

112-
struct WINRT_IMPL_NOVTABLE IContextCallback : unknown_abi
112+
struct WINRT_IMPL_ABI_DECL IContextCallback : unknown_abi
113113
{
114114
virtual int32_t __stdcall ContextCallback(int32_t(__stdcall* callback)(com_callback_args*), com_callback_args* args, guid const& iid, int method, void* reserved) noexcept = 0;
115115
};
116116

117-
struct WINRT_IMPL_NOVTABLE IServerSecurity : unknown_abi
117+
struct WINRT_IMPL_ABI_DECL IServerSecurity : unknown_abi
118118
{
119119
virtual int32_t __stdcall QueryBlanket(uint32_t*, uint32_t*, wchar_t**, uint32_t*, uint32_t*, void**, uint32_t*) noexcept = 0;
120120
virtual int32_t __stdcall ImpersonateClient() noexcept = 0;
121121
virtual int32_t __stdcall RevertToSelf() noexcept = 0;
122122
virtual int32_t __stdcall IsImpersonating() noexcept = 0;
123123
};
124124

125-
struct WINRT_IMPL_NOVTABLE IBufferByteAccess : unknown_abi
125+
struct WINRT_IMPL_ABI_DECL IBufferByteAccess : unknown_abi
126126
{
127127
virtual int32_t __stdcall Buffer(uint8_t** value) noexcept = 0;
128128
};
129129

130-
struct WINRT_IMPL_NOVTABLE IMemoryBufferByteAccess : unknown_abi
130+
struct WINRT_IMPL_ABI_DECL IMemoryBufferByteAccess : unknown_abi
131131
{
132132
virtual int32_t __stdcall GetBuffer(uint8_t** value, uint32_t* capacity) noexcept = 0;
133133
};

strings/base_activation.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,7 @@ namespace winrt::impl
280280
}
281281

282282
private:
283-
284-
size_t& m_count;
283+
[[maybe_unused]] size_t& m_count; // Field is unused when WINRT_NO_MODULE_LOCK is defined.
285284
};
286285

287286
struct factory_cache_entry_base

0 commit comments

Comments
 (0)