File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,21 @@ static void GetOSInformation(const FunctionCallbackInfo<Value>& args) {
9191 return ;
9292 }
9393
94+ #ifdef _WIN32
95+ // On Windows, uv_os_uname may return "unknown" for the machine field on ARM64.
96+ // Try to detect the processor architecture via Windows APIs.
97+ if (strcmp (info.machine , " unknown" ) == 0 ) {
98+ SYSTEM_INFO sys_info;
99+ GetSystemInfo (&sys_info);
100+
101+ // Map Windows processor architecture to machine designations
102+ // PROCESSOR_ARCHITECTURE_ARM64 = 12
103+ if (sys_info.wProcessorArchitecture == 12 ) {
104+ snprintf (info.machine , sizeof (info.machine ), " arm64" );
105+ }
106+ }
107+ #endif
108+
94109 // [sysname, version, release, machine]
95110 Local<Value> osInformation[4 ];
96111 if (String::NewFromUtf8 (env->isolate (), info.sysname )
You can’t perform that action at this time.
0 commit comments