From 64bfb1d560eab476fc03e3f9468265ac9bbd597d Mon Sep 17 00:00:00 2001 From: fengmk2 Date: Mon, 10 Mar 2025 20:40:42 +0800 Subject: [PATCH] fix: use std::string to support node 22 --- src/platform/win/report_win.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/platform/win/report_win.cc b/src/platform/win/report_win.cc index 69ffb8a..348b8c4 100644 --- a/src/platform/win/report_win.cc +++ b/src/platform/win/report_win.cc @@ -125,7 +125,7 @@ string GetOsVersion() { LPSERVER_INFO_101 os_info = NULL; NET_API_STATUS nStatus = NetServerGetInfo(NULL, level, (LPBYTE*)&os_info); if (nStatus == NERR_Success) { - LPSTR os_name = "Windows"; + std::string os_name = "Windows"; const DWORD major = os_info->sv101_version_major & MAJOR_VERSION_MASK; const DWORD type = os_info->sv101_type; const bool isServer = (type & SV_TYPE_DOMAIN_CTRL) || @@ -165,7 +165,7 @@ string GetOsVersion() { default: os_name = (isServer ? "Windows Server" : "Windows Client"); } - data << os_name; + data << os_name.c_str(); // Convert and print the machine name and comment fields (these are LPWSTR // types) @@ -201,4 +201,4 @@ string GetOsVersion() { } // namespace xprofiler -#endif \ No newline at end of file +#endif