Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.

Commit

Permalink
fix: build error on wdk 19041.
Browse files Browse the repository at this point in the history
  • Loading branch information
MiroKaku committed Jun 26, 2022
1 parent 66c1d05 commit 911dae2
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 24 deletions.
40 changes: 24 additions & 16 deletions msvc/ucxxrt.test.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -151,51 +151,59 @@
<PropertyGroup />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
<IntDir>$(SolutionDIr).vs\$(ProjectName)\$(PlatformShortName).$(Configuration.ToLower())\</IntDir>
<OutDir>$(SolutionDir)bin\$(PlatformShortName)\$(Configuration.ToLower())\</OutDir>
<IntDir>$(SolutionDIr).vs\$(ProjectName)\$(PlatformShortName.ToLower()).$(Configuration.ToLower())\</IntDir>
<OutDir>$(SolutionDir)bin\$(PlatformShortName.ToLower())\$(Configuration.ToLower())\</OutDir>
<ApiValidator_Enable>false</ApiValidator_Enable>
<Inf2CatUseLocalTime>true</Inf2CatUseLocalTime>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
<IntDir>$(SolutionDIr).vs\$(ProjectName)\$(PlatformShortName).$(Configuration.ToLower())\</IntDir>
<OutDir>$(SolutionDir)bin\$(PlatformShortName)\$(Configuration.ToLower())\</OutDir>
<IntDir>$(SolutionDIr).vs\$(ProjectName)\$(PlatformShortName.ToLower()).$(Configuration.ToLower())\</IntDir>
<OutDir>$(SolutionDir)bin\$(PlatformShortName.ToLower())\$(Configuration.ToLower())\</OutDir>
<ApiValidator_Enable>false</ApiValidator_Enable>
<Inf2CatUseLocalTime>true</Inf2CatUseLocalTime>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
<IntDir>$(SolutionDIr).vs\$(ProjectName)\$(PlatformShortName).$(Configuration.ToLower())\</IntDir>
<OutDir>$(SolutionDir)bin\$(PlatformShortName)\$(Configuration.ToLower())\</OutDir>
<IntDir>$(SolutionDIr).vs\$(ProjectName)\$(PlatformShortName.ToLower()).$(Configuration.ToLower())\</IntDir>
<OutDir>$(SolutionDir)bin\$(PlatformShortName.ToLower())\$(Configuration.ToLower())\</OutDir>
<ApiValidator_Enable>false</ApiValidator_Enable>
<Inf2CatUseLocalTime>true</Inf2CatUseLocalTime>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
<IntDir>$(SolutionDIr).vs\$(ProjectName)\$(PlatformShortName).$(Configuration.ToLower())\</IntDir>
<OutDir>$(SolutionDir)bin\$(PlatformShortName)\$(Configuration.ToLower())\</OutDir>
<IntDir>$(SolutionDIr).vs\$(ProjectName)\$(PlatformShortName.ToLower()).$(Configuration.ToLower())\</IntDir>
<OutDir>$(SolutionDir)bin\$(PlatformShortName.ToLower())\$(Configuration.ToLower())\</OutDir>
<ApiValidator_Enable>false</ApiValidator_Enable>
<Inf2CatUseLocalTime>true</Inf2CatUseLocalTime>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
<OutDir>$(SolutionDir)bin\$(PlatformShortName)\$(Configuration.ToLower())\</OutDir>
<IntDir>$(SolutionDIr).vs\$(ProjectName)\$(Platform).$(Configuration)\</IntDir>
<OutDir>$(SolutionDir)bin\$(PlatformShortName.ToLower())\$(Configuration.ToLower())\</OutDir>
<IntDir>$(SolutionDIr).vs\$(ProjectName)\$(PlatformShortName.ToLower()).$(Configuration.ToLower())\</IntDir>
<ApiValidator_Enable>false</ApiValidator_Enable>
<Inf2CatUseLocalTime>true</Inf2CatUseLocalTime>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
<OutDir>$(SolutionDir)bin\$(PlatformShortName)\$(Configuration.ToLower())\</OutDir>
<IntDir>$(SolutionDIr).vs\$(ProjectName)\$(Platform).$(Configuration)\</IntDir>
<OutDir>$(SolutionDir)bin\$(PlatformShortName.ToLower())\$(Configuration.ToLower())\</OutDir>
<IntDir>$(SolutionDIr).vs\$(ProjectName)\$(PlatformShortName.ToLower()).$(Configuration.ToLower())\</IntDir>
<ApiValidator_Enable>false</ApiValidator_Enable>
<Inf2CatUseLocalTime>true</Inf2CatUseLocalTime>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
<OutDir>$(SolutionDir)bin\$(PlatformShortName)\$(Configuration.ToLower())\</OutDir>
<IntDir>$(SolutionDIr).vs\$(ProjectName)\$(Platform).$(Configuration)\</IntDir>
<OutDir>$(SolutionDir)bin\$(PlatformShortName.ToLower())\$(Configuration.ToLower())\</OutDir>
<IntDir>$(SolutionDIr).vs\$(ProjectName)\$(PlatformShortName.ToLower()).$(Configuration.ToLower())\</IntDir>
<ApiValidator_Enable>false</ApiValidator_Enable>
<Inf2CatUseLocalTime>true</Inf2CatUseLocalTime>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
<OutDir>$(SolutionDir)bin\$(PlatformShortName)\$(Configuration.ToLower())\</OutDir>
<IntDir>$(SolutionDIr).vs\$(ProjectName)\$(Platform).$(Configuration)\</IntDir>
<OutDir>$(SolutionDir)bin\$(PlatformShortName.ToLower())\$(Configuration.ToLower())\</OutDir>
<IntDir>$(SolutionDIr).vs\$(ProjectName)\$(PlatformShortName.ToLower()).$(Configuration.ToLower())\</IntDir>
<ApiValidator_Enable>false</ApiValidator_Enable>
<Inf2CatUseLocalTime>true</Inf2CatUseLocalTime>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Link />
Expand Down
8 changes: 8 additions & 0 deletions msvc/ucxxrt.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,14 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">true</ExcludedFromBuild>
</MASM>
<MASM Include="..\src\crt\x64\guard_dispatch.asm">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">true</ExcludedFromBuild>
</MASM>
<MASM Include="..\src\crt\x64\handlers.asm">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
Expand Down
3 changes: 3 additions & 0 deletions msvc/ucxxrt.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -807,5 +807,8 @@
<MASM Include="..\src\crt\i386\exsup3.asm">
<Filter>ucxxrt\crt\i386</Filter>
</MASM>
<MASM Include="..\src\crt\x64\guard_dispatch.asm">
<Filter>ucxxrt\crt\x64</Filter>
</MASM>
</ItemGroup>
</Project>
24 changes: 24 additions & 0 deletions src/crt/x64/guard_dispatch.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
;***
;guard_dispatch.asm
;
; Copyright (c) Microsoft Corporation. All rights reserved.
;
;*******************************************************************************

include ksamd64.inc

EXTRN __guard_dispatch_icall_fptr:qword

LEAF_ENTRY _guard_dispatch_icall_nop, _TEXT

jmp rax

LEAF_END _guard_dispatch_icall_nop, _TEXT

LEAF_ENTRY _guard_xfg_dispatch_icall_nop, _TEXT

jmp __guard_dispatch_icall_fptr

LEAF_END _guard_xfg_dispatch_icall_nop, _TEXT

END
2 changes: 1 addition & 1 deletion src/ucrt/heap/msize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// _msize_base will have identical COMDATs, and the linker will fold
// them when calling one from the CRT. This is necessary because _msize
// needs to support users patching in custom implementations.
extern "C" __declspec(noinline) size_t __cdecl _msize_base(void* const block) noexcept
extern "C" __declspec(noinline) size_t __cdecl _msize_base(void* const block) _CRT_NOEXCEPT
{
size_t size = 0;
BOOLEAN quota_charged = FALSE;
Expand Down
13 changes: 9 additions & 4 deletions src/ucrt/misc/errno.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//
#include <internal_shared.h>
#include <corecrt_internal.h>
#include <vcstartup_internal.h>
#include <errno.h>

_CRT_BEGIN_C_HEADER
Expand Down Expand Up @@ -86,23 +87,27 @@ int __cdecl __acrt_errno_from_os_error(long const oserrno)
return EINVAL;
}

#if (WDK_NTDDI_VERSION < 0x0A00000A /*NTDDI_WIN10_FE*/)
// These safely set and get the value of the calling thread's errno
errno_t __cdecl _set_errno(_In_ int const value)
errno_t __cdecl _set_errno_default(_In_ int const value)
{
errno = value;
return 0;
}

errno_t __cdecl _get_errno(_Out_ int* const result)
errno_t __cdecl _get_errno_default(_Out_ int* const result)
{
_VALIDATE_RETURN_NOERRNO(result != nullptr, EINVAL);

// Unlike most of our globals, this one is guaranteed to give some answer
*result = errno;
return 0;
}
#endif // (WDK_NTDDI_VERSION < 0x0A00000A /*NTDDI_WIN10_FE*/)

_VCRT_DECLARE_ALTERNATE_NAME(_set_errno, _set_errno_default);
_VCRT_DECLARE_ALTERNATE_NAME(_get_errno, _get_errno_default);

static auto _set_errno_dummy = &_set_errno;
static auto _get_errno_dummy = &_get_errno;

// These safely set and get the value of the calling thread's doserrno
errno_t __cdecl _set_doserrno(_In_ unsigned long const value)
Expand Down
3 changes: 0 additions & 3 deletions src/ucxxrt.inl
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@
# endif
#endif

#undef NTDDI_VERSION
#define NTDDI_VERSION NTDDI_WIN10_CO

#include <veil/veil.h>
#include <corecrt.h>

Expand Down

0 comments on commit 911dae2

Please sign in to comment.