diff --git a/cxplat/cxplat_test/cxplat_memory_test.cpp b/cxplat/cxplat_test/cxplat_memory_test.cpp index bd79cdb..df62973 100644 --- a/cxplat/cxplat_test/cxplat_memory_test.cpp +++ b/cxplat/cxplat_test/cxplat_memory_test.cpp @@ -63,4 +63,28 @@ TEST_CASE("reallocate aligned", "[memory]") cxplat_free(new_buffer); } -TEST_CASE("cxplat_free null", "[ex]") { cxplat_free(nullptr); } \ No newline at end of file +TEST_CASE("cxplat_free null", "[memory]") { cxplat_free(nullptr); } + +TEST_CASE("cxplat_duplicate_string", "[memory]") +{ + char* string = cxplat_duplicate_string("test"); + REQUIRE(string != nullptr); + REQUIRE(strcmp(string, "test") == 0); + + cxplat_free(string); +} + +TEST_CASE("cxplat_duplicate_utf8_string", "[memory]") +{ + const char string[] = "test"; + cxplat_utf8_string_t source = CXPLAT_UTF8_STRING_FROM_CONST_STRING(string); + REQUIRE(source.length == strlen(string)); + + cxplat_utf8_string_t destination; + cxplat_status_t status = cxplat_duplicate_utf8_string(&destination, &source); + REQUIRE(status == CXPLAT_STATUS_SUCCESS); + REQUIRE(destination.length == source.length); + REQUIRE(memcmp(destination.value, source.value, source.length) == 0); + + cxplat_utf8_string_free(&destination); +} \ No newline at end of file diff --git a/cxplat/inc/cxplat_memory.h b/cxplat/inc/cxplat_memory.h index 7cebd4e..fb403e9 100644 --- a/cxplat/inc/cxplat_memory.h +++ b/cxplat/inc/cxplat_memory.h @@ -2,8 +2,11 @@ // SPDX-License-Identifier: MIT #pragma once +#pragma warning(push) +#pragma warning(disable: 4005 4083 4616) #include #include +#pragma warning(pop) #ifdef __cplusplus extern "C" @@ -18,6 +21,25 @@ extern "C" CxPlatNonPagedPoolNxCacheAligned = CxPlatNonPagedPoolNx + 4, } cxplat_pool_type_t; + /** + * @brief A UTF-8 encoded string. + * Notes: + * 1) This string is not NULL terminated, instead relies on length. + * 2) A single UTF-8 code point (aka character) could be 1-4 bytes in + * length. + * + */ + typedef struct _cxplat_utf8_string + { + uint8_t* value; + size_t length; + } cxplat_utf8_string_t; + + #define CXPLAT_UTF8_STRING_FROM_CONST_STRING(x) \ + { \ + ((uint8_t*)(x)), sizeof((x)) - 1 \ + } + /** * @brief Allocate memory. * @param[in] size Size of memory to allocate. @@ -91,6 +113,36 @@ extern "C" void cxplat_free_cache_aligned(_Frees_ptr_opt_ void* memory); + /** + * @brief Allocate and copy a UTF-8 string. + * + * @param[out] destination Pointer to memory where the new UTF-8 character + * sequence will be allocated. + * @param[in] source UTF-8 string that will be copied. + * @retval CXPLAT_STATUS_SUCCESS The operation was successful. + * @retval CXPLAT_STATUS_NO_MEMORY Unable to allocate resources for this + * UTF-8 string. + */ + _Must_inspect_result_ cxplat_status_t + cxplat_duplicate_utf8_string(_Out_ cxplat_utf8_string_t* destination, _In_ const cxplat_utf8_string_t* source); + + /** + * @brief Free a UTF-8 string allocated by cxplat_duplicate_utf8_string. + * + * @param[in,out] string The string to free. + */ + void + cxplat_utf8_string_free(_Inout_ cxplat_utf8_string_t* string); + + /** + * @brief Duplicate a null-terminated string. + * + * @param[in] source String to duplicate. + * @return Pointer to the duplicated string or NULL if out of memory. + */ + _Must_inspect_result_ char* + cxplat_duplicate_string(_In_z_ const char* source); + #ifdef __cplusplus } #endif \ No newline at end of file diff --git a/cxplat/inc/winkernel/cxplat_winkernel.h b/cxplat/inc/winkernel/cxplat_winkernel.h index 3dd8487..e4e744b 100644 --- a/cxplat/inc/winkernel/cxplat_winkernel.h +++ b/cxplat/inc/winkernel/cxplat_winkernel.h @@ -1,7 +1,10 @@ // Copyright (c) Microsoft Corporation // SPDX-License-Identifier: MIT #pragma once -#include +#if !defined(_AMD64_) && defined(_M_AMD64) +#define _AMD64_ +#endif +#include // for NTSTATUS #include // Map specific cxplat_status_t values to HRESULT values. diff --git a/cxplat/src/cxplat_winkernel/CMakeLists.txt b/cxplat/src/cxplat_winkernel/CMakeLists.txt index 9c3bb80..d99325c 100644 --- a/cxplat/src/cxplat_winkernel/CMakeLists.txt +++ b/cxplat/src/cxplat_winkernel/CMakeLists.txt @@ -1,3 +1,23 @@ # Copyright (c) Microsoft Corporation # SPDX-License-Identifier: MIT +add_library(cxplat_winkernel STATIC + ../../inc/cxplat.h + ../../inc/cxplat_common.h + ../../inc/cxplat_fault_injection.h + ../../inc/cxplat_memory.h + ../../inc/winkernel/cxplat_platform.h + ../../inc/winkernel/cxplat_winkernel.h + ../memory.c + memory_winkernel.c +) + +target_include_directories(cxplat_winkernel PRIVATE + "." + "../../inc" + "../../inc/winkernel" + "${WDK_ROOT}/include/${WDK_VERSION}/km" +) + +set(defs UNICODE _UNICODE CXPLAT_SOURCE) +target_compile_definitions(cxplat_winkernel PRIVATE ${defs}) diff --git a/cxplat/src/cxplat_winkernel/cxplat_winkernel.vcxproj b/cxplat/src/cxplat_winkernel/cxplat_winkernel.vcxproj index 268531e..d86021d 100644 --- a/cxplat/src/cxplat_winkernel/cxplat_winkernel.vcxproj +++ b/cxplat/src/cxplat_winkernel/cxplat_winkernel.vcxproj @@ -1,143 +1,178 @@ - + + - + Debug - Win32 + x64 - - Release - Win32 + + FuzzerDebug + ARM64 - - Debug + + FuzzerDebug x64 Release x64 + + Debug + ARM64 + + + Release + ARM64 + + + + + + true + - + + + + + + - 17.0 - Win32Proj {1ebe3966-7dc4-49b4-b840-3d33d63415ec} + {0a049372-4c4d-4ea0-a64e-dc6ad88ceca1} + v4.5 + 12.0 + Debug + Win32 cxplatwinkernel - 10.0 + KMDF + cxplat_winkernel + $(LatestTargetPlatformVersion) - - StaticLibrary + + Windows10 true - v143 + WindowsKernelModeDriver10.0 + StaticLibrary + Universal Unicode + Spectre + false - + + Windows10 + true + WindowsKernelModeDriver10.0 StaticLibrary - false - v143 - true + Universal Unicode + Spectre + false - + + Windows10 + false + WindowsKernelModeDriver10.0 StaticLibrary + Universal + Unicode + false + + + Windows10 true WindowsKernelModeDriver10.0 + StaticLibrary + Universal Unicode - + + Windows10 + true + WindowsKernelModeDriver10.0 StaticLibrary + Universal + Unicode + + + Windows10 false WindowsKernelModeDriver10.0 - true + StaticLibrary + Universal Unicode - - - - - - - - - - - - + - + + + + - Level3 - true - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) - true - Use - pch.h + _DEBUG;WINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP;WINAPI_PARTITION_DESKTOP=1;WINAPI_PARTITION_SYSTEM=1;WINAPI_PARTITION_APP=1;WINAPI_PARTITION_PC_APP=1;_KRPCENV_;_NO_CRT_STDIO_INLINE=1;%(PreprocessorDefinitions) + $(ProjectDir)../../inc;$(ProjectDir)../../inc/winkernel + stdcpp20 - - - - true - + + _KRPCENV_;%(PreprocessorDefinitions) + + + $(SolutionDir)$(Platform)\$(ConfigurationName)\ + - + - Level3 - true - true - true - WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - true - Use - pch.h + _DEBUG;WINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP;WINAPI_PARTITION_DESKTOP=1;WINAPI_PARTITION_SYSTEM=1;WINAPI_PARTITION_APP=1;WINAPI_PARTITION_PC_APP=1;_KRPCENV_;_NO_CRT_STDIO_INLINE=1;%(PreprocessorDefinitions) + $(ProjectDir)../../inc;$(ProjectDir)../../inc/winkernel + stdcpp20 - - - - true - true - true - + + _KRPCENV_;%(PreprocessorDefinitions) + + + $(SolutionDir)$(Platform)\$(ConfigurationName)\ + - + - Level3 - true - _DEBUG;_LIB;%(PreprocessorDefinitions) - true + WINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP;WINAPI_PARTITION_DESKTOP=1;WINAPI_PARTITION_SYSTEM=1;WINAPI_PARTITION_APP=1;WINAPI_PARTITION_PC_APP=1;_KRPCENV_;_NO_CRT_STDIO_INLINE=1;%(PreprocessorDefinitions) + $(ProjectDir)../../inc;$(ProjectDir)../../inc/winkernel + stdcpp20 - - - - true - + + _KRPCENV_;%(PreprocessorDefinitions) + + + $(SolutionDir)$(Platform)\$(ConfigurationName)\ + - + + + _DEBUG;WINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP;WINAPI_PARTITION_DESKTOP=1;WINAPI_PARTITION_SYSTEM=1;WINAPI_PARTITION_APP=1;WINAPI_PARTITION_PC_APP=1;%(PreprocessorDefinitions) + + + + + _DEBUG;WINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP;WINAPI_PARTITION_DESKTOP=1;WINAPI_PARTITION_SYSTEM=1;WINAPI_PARTITION_APP=1;WINAPI_PARTITION_PC_APP=1;%(PreprocessorDefinitions) + + + - Level3 - true - true - true - NDEBUG;_LIB;%(PreprocessorDefinitions) - true - Use - pch.h + WINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP;WINAPI_PARTITION_DESKTOP=1;WINAPI_PARTITION_SYSTEM=1;WINAPI_PARTITION_APP=1;WINAPI_PARTITION_PC_APP=1;%(PreprocessorDefinitions) - - - - true - true - true - diff --git a/cxplat/src/cxplat_winkernel/cxplat_winkernel.vcxproj.filters b/cxplat/src/cxplat_winkernel/cxplat_winkernel.vcxproj.filters index 001643d..458d5bc 100644 --- a/cxplat/src/cxplat_winkernel/cxplat_winkernel.vcxproj.filters +++ b/cxplat/src/cxplat_winkernel/cxplat_winkernel.vcxproj.filters @@ -15,7 +15,30 @@ - + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + Header Files diff --git a/cxplat/src/cxplat_winkernel/memory_winkernel.c b/cxplat/src/cxplat_winkernel/memory_winkernel.c new file mode 100644 index 0000000..6e2fb0d --- /dev/null +++ b/cxplat/src/cxplat_winkernel/memory_winkernel.c @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation +// SPDX-License-Identifier: MIT + +#include "cxplat.h" +#include + +__drv_allocatesMem(Mem) _Must_inspect_result_ _Ret_writes_maybenull_(size) void* cxplat_allocate_with_tag( + _In_ cxplat_pool_type_t pool_type, size_t size, uint32_t tag, bool initialize) +{ + if (initialize) { +#pragma warning(suppress : 4996) + return ExAllocatePoolWithTag(pool_type, size, tag); + } else { + return ExAllocatePoolUninitialized(pool_type, size, tag); + } +} + +__drv_allocatesMem(Mem) _Must_inspect_result_ _Ret_writes_maybenull_(new_size) void* cxplat_reallocate_with_tag( + _In_ _Post_invalid_ void* pointer, size_t old_size, size_t new_size, uint32_t tag) +{ + void* new_pointer = cxplat_allocate_with_tag(CxPlatNonPagedPoolNx, new_size, tag, true); + if (!new_pointer) { + return NULL; + } + memcpy(new_pointer, pointer, min(old_size, new_size)); + cxplat_free(pointer); + return new_pointer; +} + +void +cxplat_free(_Frees_ptr_opt_ void* pointer) +{ + if (pointer != NULL) + { + ExFreePool(pointer); + } +} + +_Must_inspect_result_ + _Ret_writes_maybenull_(size) void* cxplat_allocate_cache_aligned_with_tag(size_t size, uint32_t tag) +{ + return cxplat_allocate_with_tag(CxPlatNonPagedPoolNxCacheAligned, size, tag, false); +} + +void +cxplat_free_cache_aligned(_Pre_maybenull_ _Post_ptr_invalid_ void* memory) +{ + cxplat_free(memory); +} diff --git a/cxplat/src/cxplat_winuser/CMakeLists.txt b/cxplat/src/cxplat_winuser/CMakeLists.txt index b289d74..161a16a 100644 --- a/cxplat/src/cxplat_winuser/CMakeLists.txt +++ b/cxplat/src/cxplat_winuser/CMakeLists.txt @@ -12,7 +12,8 @@ add_library(cxplat_winuser STATIC fault_injection.cpp leak_detector.cpp leak_detector.h - memory.cpp + ../memory.c + memory_winuser.cpp symbol_decoder.h winuser_internal.h ) diff --git a/cxplat/src/cxplat_winuser/cxplat_winuser.vcxproj b/cxplat/src/cxplat_winuser/cxplat_winuser.vcxproj index 9b916ec..08d6c2e 100644 --- a/cxplat/src/cxplat_winuser/cxplat_winuser.vcxproj +++ b/cxplat/src/cxplat_winuser/cxplat_winuser.vcxproj @@ -150,10 +150,11 @@ + - + diff --git a/cxplat/src/cxplat_winuser/cxplat_winuser.vcxproj.filters b/cxplat/src/cxplat_winuser/cxplat_winuser.vcxproj.filters index 67fe240..edbbdd2 100644 --- a/cxplat/src/cxplat_winuser/cxplat_winuser.vcxproj.filters +++ b/cxplat/src/cxplat_winuser/cxplat_winuser.vcxproj.filters @@ -53,7 +53,10 @@ Source Files - + + Source Files + + Source Files diff --git a/cxplat/src/cxplat_winuser/memory.cpp b/cxplat/src/cxplat_winuser/memory_winuser.cpp similarity index 90% rename from cxplat/src/cxplat_winuser/memory.cpp rename to cxplat/src/cxplat_winuser/memory_winuser.cpp index 1cc5793..b6db467 100644 --- a/cxplat/src/cxplat_winuser/memory.cpp +++ b/cxplat/src/cxplat_winuser/memory_winuser.cpp @@ -21,8 +21,6 @@ extern cxplat_leak_detector_ptr _cxplat_leak_detector_ptr; extern "C" size_t cxplat_fuzzing_memory_limit = MAXSIZE_T; -#define CXPLAT_DEFAULT_TAG 'lpxc' - typedef struct { cxplat_pool_type_t pool_type; @@ -117,11 +115,6 @@ __drv_allocatesMem(Mem) _Must_inspect_result_ _Ret_writes_maybenull_(size) void* return memory; } -__drv_allocatesMem(Mem) _Must_inspect_result_ _Ret_writes_maybenull_(size) void* cxplat_allocate(size_t size) -{ - return cxplat_allocate_with_tag(CxPlatNonPagedPoolNx, size, CXPLAT_DEFAULT_TAG, true); -} - __drv_allocatesMem(Mem) _Must_inspect_result_ _Ret_writes_maybenull_(new_size) void* cxplat_reallocate_with_tag( _In_ _Post_invalid_ void* pointer, size_t old_size, size_t new_size, uint32_t tag) { @@ -166,12 +159,6 @@ __drv_allocatesMem(Mem) _Must_inspect_result_ _Ret_writes_maybenull_(new_size) v return p; } -__drv_allocatesMem(Mem) _Must_inspect_result_ _Ret_writes_maybenull_(new_size) void* cxplat_reallocate( - _In_ _Post_invalid_ void* memory, size_t old_size, size_t new_size) -{ - return cxplat_reallocate_with_tag(memory, old_size, new_size, CXPLAT_DEFAULT_TAG); -} - void cxplat_free(_Frees_ptr_opt_ void* pointer) { @@ -195,10 +182,11 @@ cxplat_free(_Frees_ptr_opt_ void* pointer) } } -__drv_allocatesMem(Mem) _Must_inspect_result_ -_Ret_writes_maybenull_(size) void* -cxplat_allocate_cache_aligned(size_t size) +_Must_inspect_result_ + _Ret_writes_maybenull_(size) void* cxplat_allocate_cache_aligned_with_tag(size_t size, uint32_t tag) { + UNREFERENCED_PARAMETER(tag); + if (size > cxplat_fuzzing_memory_limit) { return nullptr; } @@ -214,14 +202,6 @@ cxplat_allocate_cache_aligned(size_t size) return memory; } -_Must_inspect_result_ - _Ret_writes_maybenull_(size) void* cxplat_allocate_cache_aligned_with_tag(size_t size, uint32_t tag) -{ - UNREFERENCED_PARAMETER(tag); - - return cxplat_allocate_cache_aligned(size); -} - void cxplat_free_cache_aligned(_Pre_maybenull_ _Post_ptr_invalid_ void* memory) { diff --git a/cxplat/src/memory.c b/cxplat/src/memory.c new file mode 100644 index 0000000..2e2e82f --- /dev/null +++ b/cxplat/src/memory.c @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation +// SPDX-License-Identifier: MIT + +#include "cxplat.h" +#include +#include + +#define CXPLAT_DEFAULT_TAG 'lpxc' + +__drv_allocatesMem(Mem) _Must_inspect_result_ _Ret_writes_maybenull_(size) void* cxplat_allocate(size_t size) +{ + return cxplat_allocate_with_tag(CxPlatNonPagedPoolNx, size, CXPLAT_DEFAULT_TAG, true); +} + +__drv_allocatesMem(Mem) _Must_inspect_result_ _Ret_writes_maybenull_(new_size) void* cxplat_reallocate( + _In_ _Post_invalid_ void* memory, size_t old_size, size_t new_size) +{ + return cxplat_reallocate_with_tag(memory, old_size, new_size, CXPLAT_DEFAULT_TAG); +} + +__drv_allocatesMem(Mem) _Must_inspect_result_ + _Ret_writes_maybenull_(size) void* cxplat_allocate_cache_aligned(size_t size) +{ + return cxplat_allocate_cache_aligned_with_tag(size, CXPLAT_DEFAULT_TAG); +} + +_Must_inspect_result_ _Ret_maybenull_z_ char* +cxplat_duplicate_string(_In_z_ const char* source) +{ + size_t size = strlen(source) + 1; + char* destination = (char*)cxplat_allocate(size); + if (destination) { + memcpy(destination, source, size); + } + return destination; +} + +_Must_inspect_result_ cxplat_status_t +cxplat_duplicate_utf8_string(_Out_ cxplat_utf8_string_t* destination, _In_ const cxplat_utf8_string_t* source) +{ + if (!source->value || !source->length) { + destination->value = NULL; + destination->length = 0; + return CXPLAT_STATUS_SUCCESS; + } else { + destination->value = (uint8_t*)cxplat_allocate(source->length); + if (!destination->value) { + return CXPLAT_STATUS_NO_MEMORY; + } + memcpy(destination->value, source->value, source->length); + destination->length = source->length; + return CXPLAT_STATUS_SUCCESS; + } +} + +void +cxplat_utf8_string_free(_Inout_ cxplat_utf8_string_t* string) +{ + cxplat_free(string->value); + string->value = NULL; + string->length = 0; +} diff --git a/src/platform.h b/src/platform.h index a90dca9..61d1874 100644 --- a/src/platform.h +++ b/src/platform.h @@ -22,11 +22,6 @@ extern "C" #define USERSIM_OFFSET_OF(s, m) (((size_t) & ((s*)0)->m)) #define USERSIM_FROM_FIELD(s, m, o) (s*)((uint8_t*)o - USERSIM_OFFSET_OF(s, m)) -#define USERSIM_UTF8_STRING_FROM_CONST_STRING(x) \ - { \ - ((uint8_t*)(x)), sizeof((x)) - 1 \ - } - #define USERSIM_NS_PER_FILETIME 100 // Macro locally suppresses "Unreferenced variable" warning, which in 'Release' builds is treated as an error. @@ -39,20 +34,6 @@ extern "C" while (0) \ _Pragma("warning(pop)") - /** - * @brief A UTF-8 encoded string. - * Notes: - * 1) This string is not NULL terminated, instead relies on length. - * 2) A single UTF-8 code point (aka character) could be 1-4 bytes in - * length. - * - */ - typedef struct _usersim_utf8_string - { - uint8_t* value; - size_t length; - } usersim_utf8_string_t; - typedef enum _usersim_code_integrity_state { USERSIM_CODE_INTEGRITY_DEFAULT = 0, @@ -142,36 +123,6 @@ extern "C" _Ret_maybenull_ void* usersim_ring_map_readonly_user(_In_ const usersim_ring_descriptor_t* ring); - /** - * @brief Allocate and copy a UTF-8 string. - * - * @param[out] destination Pointer to memory where the new UTF-8 character - * sequence will be allocated. - * @param[in] source UTF-8 string that will be copied. - * @retval USERSIM_SUCCESS The operation was successful. - * @retval USERSIM_NO_MEMORY Unable to allocate resources for this - * UTF-8 string. - */ - _Must_inspect_result_ usersim_result_t - usersim_duplicate_utf8_string(_Out_ usersim_utf8_string_t* destination, _In_ const usersim_utf8_string_t* source); - - /** - * @brief Free a UTF-8 string allocated by usersim_duplicate_utf8_string. - * - * @param[in,out] string The string to free. - */ - void - usersim_utf8_string_free(_Inout_ usersim_utf8_string_t* string); - - /** - * @brief Duplicate a null-terminated string. - * - * @param[in] source String to duplicate. - * @return Pointer to the duplicated string or NULL if out of memory. - */ - _Must_inspect_result_ char* - usersim_duplicate_string(_In_z_ const char* source); - /** * @brief Get the code integrity state from the platform. * @param[out] state The code integrity state being enforced. @@ -607,7 +558,7 @@ extern "C" */ _Must_inspect_result_ usersim_result_t usersim_cryptographic_hash_create( - _In_ const usersim_utf8_string_t* algorithm, _Outptr_ usersim_cryptographic_hash_t** hash); + _In_ const cxplat_utf8_string_t* algorithm, _Outptr_ usersim_cryptographic_hash_t** hash); /** * @brief Destroy a cryptographic hash object. @@ -701,7 +652,7 @@ extern "C" * @retval USERSIM_INVALID_ARGUMENT Unable to convert the string. */ usersim_result_t - usersim_utf8_string_to_unicode(_In_ const usersim_utf8_string_t* input, _Outptr_ wchar_t** output); + usersim_utf8_string_to_unicode(_In_ const cxplat_utf8_string_t* input, _Outptr_ wchar_t** output); #ifdef __cplusplus } diff --git a/src/platform_user.cpp b/src/platform_user.cpp index bb0fc7d..e986ca5 100644 --- a/src/platform_user.cpp +++ b/src/platform_user.cpp @@ -720,7 +720,7 @@ usersim_leave_critical_region() } usersim_result_t -usersim_utf8_string_to_unicode(_In_ const usersim_utf8_string_t* input, _Outptr_ wchar_t** output) +usersim_utf8_string_to_unicode(_In_ const cxplat_utf8_string_t* input, _Outptr_ wchar_t** output) { wchar_t* unicode_string = NULL; usersim_result_t retval; diff --git a/src/tracelog.c b/src/tracelog.c index 083b6ed..697352e 100644 --- a/src/tracelog.c +++ b/src/tracelog.c @@ -387,7 +387,7 @@ __declspec(noinline) void usersim_log_message_utf8_string( usersim_tracelog_level_t trace_level, usersim_tracelog_keyword_t keyword, _In_z_ const char* message, - _In_ const usersim_utf8_string_t* string) + _In_ const cxplat_utf8_string_t* string) { switch (trace_level) { CASE_LOG_ALWAYS: diff --git a/src/tracelog.h b/src/tracelog.h index f78dc9d..d38a8fa 100644 --- a/src/tracelog.h +++ b/src/tracelog.h @@ -164,7 +164,7 @@ extern "C" usersim_tracelog_level_t trace_level, usersim_tracelog_keyword_t keyword, _In_z_ const char* message, - _In_ const usersim_utf8_string_t* string); + _In_ const cxplat_utf8_string_t* string); #define USERSIM_LOG_MESSAGE_UTF8_STRING(trace_level, keyword, message, value) \ if (TraceLoggingProviderEnabled(usersim_tracelog_provider, trace_level, keyword)) { \ usersim_log_message_utf8_string(_##trace_level##, _##keyword##, message, value); \