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

Commit

Permalink
fix(CI): enable X86 and ARM build support
Browse files Browse the repository at this point in the history
  • Loading branch information
MiroKaku committed Jul 19, 2022
1 parent bae1887 commit f147798
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 18 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/EnableX86&ARM.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
$texts = @(
" '`$(Platform)' is not a valid architecture for Kernel mode drivers or UMDF drivers"
" '`$(TargetVersion)' is not a supported OS Version"
)

$path = Resolve-Path "C:\Program Files (x86)\Windows Kits\10\build\*\WindowsDriver.common.targets"
[XML] $targets = Get-Content $path

Write-Host ("[*] Loaded targets ""{0}"" into ""{1}""" -f $path, $targets)

[System.Xml.XmlNamespaceManager] $nsmgr = $targets.NameTable
$nsmgr.AddNamespace('ns', 'http://schemas.microsoft.com/developer/msbuild/2003')

foreach ( $text in $texts )
{
$XPath = [string]::Format('//ns:Error[@Text="{0}"]', $text)
Write-Host ("[+] XPath is ""{0}""" -f $XPath)

$node = $targets.SelectSingleNode($XPath, $nsmgr)
if ($node)
{
Write-Host ("[-] Removing node ""{0}""" -f $node.Text)
$node.ParentNode.RemoveChild($node);
}
}

$targets.Save($path)
5 changes: 5 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ jobs:
$FilePath = Resolve-Path "C:\Program Files (x86)\Windows Kits\10\Vsix\VS2022\*\WDK.vsix"
Install-VsixExtension -FilePath $FilePath -Name "WDK.vsix" -VSversion "2022" -InstallOnly
- name: enable X86 and ARM build support
working-directory: ${{github.workspace}}
shell: pwsh
run: & '.\.github\workflows\EnableX86&ARM.ps1'

- name: build nuspec
if: contains(github.ref, 'tags/')
working-directory: ${{github.workspace}}
Expand Down
3 changes: 0 additions & 3 deletions src/ucrt/misc/errno.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,6 @@ errno_t __cdecl _get_errno_default(_Out_ int* const result)
_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
28 changes: 13 additions & 15 deletions src/ucrt/misc/invalid_parameter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@
#include <vcstartup_internal.h>


_VCRT_DECLARE_ALTERNATE_NAME(_invoke_watson, _invoke_watson_default);
#ifdef _DEBUG
_VCRT_DECLARE_ALTERNATE_NAME(_invalid_parameter, _invalid_parameter_default);
#endif
_VCRT_DECLARE_ALTERNATE_NAME(_invalid_parameter_noinfo, _invalid_parameter_noinfo_default);
_VCRT_DECLARE_ALTERNATE_NAME(_invalid_parameter_noinfo_noreturn, _invalid_parameter_noinfo_noreturn_default);


static _invalid_parameter_handler __acrt_invalid_parameter_handler;


Expand All @@ -18,12 +26,12 @@ extern "C" void __cdecl __acrt_initialize_invalid_parameter_handler(void* const
}



//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
//
// _invalid_parameter
//
//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

extern "C" void __cdecl _invalid_parameter_internal(
wchar_t const* const expression,
wchar_t const* const function_name,
Expand Down Expand Up @@ -62,32 +70,25 @@ extern "C" void __cdecl _invalid_parameter_default(

extern "C" void __cdecl _invalid_parameter_noinfo_default()
{
_invalid_parameter(nullptr, nullptr, nullptr, 0, 0);
_invalid_parameter_internal(nullptr, nullptr, nullptr, 0, 0);
}

// This is used by inline code in the C++ Standard Library and the SafeInt
// library. Because it is __declspec(noreturn), the compiler can better
// optimize use of the invalid parameter handler for inline code.
extern "C" __declspec(noreturn) void __cdecl _invalid_parameter_noinfo_noreturn_default()
{
_invalid_parameter(nullptr, nullptr, nullptr, 0, 0);
_invoke_watson (nullptr, nullptr, nullptr, 0, 0);
_invalid_parameter_internal(nullptr, nullptr, nullptr, 0, 0);
_invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}

_VCRT_DECLARE_ALTERNATE_NAME(_invalid_parameter, _invalid_parameter_default);
_VCRT_DECLARE_ALTERNATE_NAME(_invalid_parameter_noinfo, _invalid_parameter_noinfo_default);
_VCRT_DECLARE_ALTERNATE_NAME(_invalid_parameter_noinfo_noreturn, _invalid_parameter_noinfo_noreturn_default);

static auto _invalid_parameter_dummy = &_invalid_parameter;
static auto _invalid_parameter_noinfo_dummy = &_invalid_parameter_noinfo;
static auto _invalid_parameter_noinfo_noreturn_dummy = &_invalid_parameter_noinfo_noreturn;


//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
//
// _invoke_watson
//
//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

extern "C" __declspec(noreturn) void __cdecl _invoke_watson_default(
wchar_t const* const expression,
wchar_t const* const function_name,
Expand All @@ -105,9 +106,6 @@ extern "C" __declspec(noreturn) void __cdecl _invoke_watson_default(
__fastfail(FAST_FAIL_INVALID_ARG);
}

_VCRT_DECLARE_ALTERNATE_NAME(_invoke_watson, _invoke_watson_default);
static auto _invoke_watson_dummy = &_invoke_watson;


//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
//
Expand Down

0 comments on commit f147798

Please sign in to comment.