diff options
| author | ruki <[email protected]> | 2025-09-11 11:51:12 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-09-11 11:51:12 +0800 |
| commit | 9ac44c13a82a49abfd37e425b967efebbbb9ab7c (patch) | |
| tree | a9de74e910024f38251387306d9b1853853bcf15 /tests | |
| parent | e47954aadbb5dd06b9a09b31792de72cc01295a4 (diff) | |
| parent | 2f16b3d37c421f975852fec05a69d35041677368 (diff) | |
Merge pull request #6785 from Arthapz/support-wdk-clang
feat(wdk rules) support clang and llvm for wdk rules
Diffstat (limited to 'tests')
6 files changed, 18 insertions, 6 deletions
diff --git a/tests/projects/windows/driver/kmdf/ioctl/exe/testapp.c b/tests/projects/windows/driver/kmdf/ioctl/exe/testapp.c index 6ec41747e..640c4a338 100644 --- a/tests/projects/windows/driver/kmdf/ioctl/exe/testapp.c +++ b/tests/projects/windows/driver/kmdf/ioctl/exe/testapp.c @@ -213,7 +213,7 @@ GetCoinstallerVersion( VOID __cdecl
main(
- _In_ ULONG argc,
+ _In_ INT argc,
_In_reads_(argc) PCHAR argv[]
)
{
diff --git a/tests/projects/windows/driver/umdf/skeleton/xmake.lua b/tests/projects/windows/driver/umdf/skeleton/xmake.lua index ee8ed00b5..547ad376b 100644 --- a/tests/projects/windows/driver/umdf/skeleton/xmake.lua +++ b/tests/projects/windows/driver/umdf/skeleton/xmake.lua @@ -8,6 +8,12 @@ target("UMDFSkeleton") add_files("*.cpp", {rules = "wdk.tracewpp"}) add_files("*.rc", "*.inx") set_values("wdk.umdf.sdkver", "1.9") - add_shflags("/DEF:exports.def", {force = true}) - add_shflags("/ENTRY:_DllMainCRTStartup" .. (is_arch("x86") and "@12" or ""), {force = true}) + add_files("exports.def") + on_config(function(target) + if target:has_tool("sh", "clang", "clangxx") then + target:add("shflags", "-Wl,/ENTRY:_DllMainCRTStartup" .. (is_arch("x86") and "@12" or ""), {force = true}) + else + target:add("shflags", "/ENTRY:_DllMainCRTStartup" .. (is_arch("x86") and "@12" or ""), {force = true}) + end + end) diff --git a/tests/projects/windows/driver/wdm/msdsm/intrface.c b/tests/projects/windows/driver/wdm/msdsm/intrface.c index 4a390c212..4266beba7 100644 --- a/tests/projects/windows/driver/wdm/msdsm/intrface.c +++ b/tests/projects/windows/driver/wdm/msdsm/intrface.c @@ -32,6 +32,7 @@ Environment: #pragma warning (disable:4305)
+DSM_INIT_DATA gDsmInitData;
//
// Flag to indicate whether to NT_ASSERT or ignore a particular condition.
@@ -3430,7 +3431,7 @@ Return Value: NTSTATUS
DsmRemovePath(
- _In_ IN PDSM_CONTEXT DsmContext,
+ _In_ IN PVOID _DsmContext,
_In_ IN PVOID PathId
)
/*++
@@ -3456,6 +3457,8 @@ Return Value: PDSM_FAILOVER_GROUP failGroup;
KIRQL irql;
+ PDSM_CONTEXT DsmContext = (PDSM_CONTEXT)_DsmContext;
+
TracePrint((TRACE_LEVEL_VERBOSE,
TRACE_FLAG_PNP,
"DsmRemovePath (PathId %p): Entering function.\n",
diff --git a/tests/projects/windows/driver/wdm/msdsm/msdsm.h b/tests/projects/windows/driver/wdm/msdsm/msdsm.h index 982ed7ffc..9962b0f80 100644 --- a/tests/projects/windows/driver/wdm/msdsm/msdsm.h +++ b/tests/projects/windows/driver/wdm/msdsm/msdsm.h @@ -115,7 +115,7 @@ Notes: //
// Initialization data structure that needs to be filled in for MPIO
//
-DSM_INIT_DATA gDsmInitData;
+extern DSM_INIT_DATA gDsmInitData;
//
// Macro used to round of a number to the nearest 8 byte aligned one.
diff --git a/tests/projects/windows/driver/wdm/msdsm/prototypes.h b/tests/projects/windows/driver/wdm/msdsm/prototypes.h index c72c22cb4..08eb5ba0d 100644 --- a/tests/projects/windows/driver/wdm/msdsm/prototypes.h +++ b/tests/projects/windows/driver/wdm/msdsm/prototypes.h @@ -206,7 +206,7 @@ DsmRemoveDevice( NTSTATUS
DsmRemovePath(
- _In_ IN PDSM_CONTEXT DsmContext,
+ _In_ IN PVOID DsmContext,
_In_ IN PVOID PathId
);
diff --git a/tests/projects/windows/driver/wdm/perfcounters/kcs.c b/tests/projects/windows/driver/wdm/perfcounters/kcs.c index 67ca0e328..610cb88e0 100644 --- a/tests/projects/windows/driver/wdm/perfcounters/kcs.c +++ b/tests/projects/windows/driver/wdm/perfcounters/kcs.c @@ -27,6 +27,9 @@ Environment: #include "kcs.h"
#include "kcsCounters.h"
+#include <stdlib.h>
+#include <math.h>
+
#pragma code_seg("PAGE")
DRIVER_INITIALIZE DriverEntry;
|
