From 82f9d834ad772b2f16b6524f679d14d8a7afe881 Mon Sep 17 00:00:00 2001 From: Gabriele Contini <gcontini@users.noreply.github.com> Date: 周二, 10 9月 2019 23:29:10 +0800 Subject: [PATCH] fix issue #37 tests in windows --- src/library/os/os-win.c | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/library/os/os-win.c b/src/library/os/os-win.c index e406ab9..a5a3bde 100644 --- a/src/library/os/os-win.c +++ b/src/library/os/os-win.c @@ -16,7 +16,7 @@ FUNCTION_RETURN result = FUNC_RET_ERROR; char buffer[MAX_COMPUTERNAME_LENGTH + 1]; int bufsize = MAX_COMPUTERNAME_LENGTH + 1; - BOOL cmpName = GetComputerName(buffer, &bufsize); + const BOOL cmpName = GetComputerName(buffer, &bufsize); if (cmpName) { strncpy(identifier, buffer, 6); result = FUNC_RET_OK; @@ -44,12 +44,12 @@ DWORD volSerial = 0; BOOL success; UINT driveType; - DWORD dwSize = MAX_PATH; + const DWORD dwSize = MAX_PATH; char szLogicalDrives[MAX_PATH] = { 0 }; unsigned char buf[8] = ""; FUNCTION_RETURN return_value; - DWORD dwResult = GetLogicalDriveStrings(dwSize, szLogicalDrives); + const DWORD dwResult = GetLogicalDriveStrings(dwSize, szLogicalDrives); if (dwResult > 0 && dwResult <= MAX_PATH) { return_value = FUNC_RET_OK; @@ -184,7 +184,7 @@ FUNCTION_RETURN getModuleName(char buffer[MAX_PATH]) { FUNCTION_RETURN result = FUNC_RET_OK; - DWORD wres = GetModuleFileName(NULL, buffer, MAX_PATH); + const DWORD wres = GetModuleFileName(NULL, buffer, MAX_PATH); if (wres == 0) { result = FUNC_RET_ERROR; } @@ -211,3 +211,11 @@ free(hashStr); } } + +/** + * Not implemented yet. + */ +VIRTUALIZATION getVirtualization() { + return NONE; +} + -- Gitblit v1.9.1