diff options
author | Rahul Kumar <rahku@microsoft.com> | 2017-04-04 01:02:19 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-04 01:02:19 -0700 |
commit | ebf4927d891757b1bd7f54119de2ad60900d3232 (patch) | |
tree | 2747e82ad422e6db94b31885ece9b17a2dd0abe5 /src/pal | |
parent | f66e306a08b3f8de10d6ad26faccd53b58a56b7e (diff) | |
parent | 201c70cc49ff2027fb8ed0ba5e25f56534b04a96 (diff) | |
download | coreclr-ebf4927d891757b1bd7f54119de2ad60900d3232.tar.gz coreclr-ebf4927d891757b1bd7f54119de2ad60900d3232.tar.bz2 coreclr-ebf4927d891757b1bd7f54119de2ad60900d3232.zip |
Merge pull request #10601 from rahku/c4996
1. Remove disable of C4996
Diffstat (limited to 'src/pal')
13 files changed, 0 insertions, 385 deletions
diff --git a/src/pal/inc/pal.h b/src/pal/inc/pal.h index 1d74358aee..589eb54831 100644 --- a/src/pal/inc/pal.h +++ b/src/pal/inc/pal.h @@ -4742,18 +4742,6 @@ typedef POSVERSIONINFOEXA POSVERSIONINFOEX; typedef LPOSVERSIONINFOEXA LPOSVERSIONINFOEX; #endif -PALIMPORT -BOOL -PALAPI -GetVersionExW( - IN OUT LPOSVERSIONINFOW lpVersionInformation); - -#ifdef UNICODE -#define GetVersionEx GetVersionExW -#else -#define GetVersionEx GetVersionExA -#endif - #define IMAGE_FILE_MACHINE_I386 0x014c #define IMAGE_FILE_MACHINE_ARM64 0xAA64 // ARM64 Little-Endian diff --git a/src/pal/inc/palprivate.h b/src/pal/inc/palprivate.h index 2677dd6bdd..554a5028ad 100644 --- a/src/pal/inc/palprivate.h +++ b/src/pal/inc/palprivate.h @@ -293,12 +293,6 @@ FreeEnvironmentStringsA( PALIMPORT BOOL PALAPI -GetVersionExA( - IN OUT LPOSVERSIONINFOA lpVersionInformation); - -PALIMPORT -BOOL -PALAPI RemoveDirectoryA( IN LPCSTR lpPathName); diff --git a/src/pal/src/CMakeLists.txt b/src/pal/src/CMakeLists.txt index f21c9dbf8f..5314cdf86b 100644 --- a/src/pal/src/CMakeLists.txt +++ b/src/pal/src/CMakeLists.txt @@ -181,7 +181,6 @@ set(SOURCES misc/sysinfo.cpp misc/time.cpp misc/utils.cpp - misc/version.cpp objmgr/palobjbase.cpp objmgr/shmobject.cpp objmgr/shmobjectmanager.cpp diff --git a/src/pal/src/misc/version.cpp b/src/pal/src/misc/version.cpp deleted file mode 100644 index 7a9f90a320..0000000000 --- a/src/pal/src/misc/version.cpp +++ /dev/null @@ -1,119 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -/*++ - - - -Module Name: - - version.c - -Abstract: - - Implementation of functions for getting platform.OS versions. - -Revision History: - - - ---*/ - -#include "pal/palinternal.h" -#include "pal/dbgmsg.h" - -SET_DEFAULT_DEBUG_CHANNEL(MISC); - -/*++ -Function: - GetVersionExA - - - -GetVersionEx - -The GetVersionEx function obtains extended information about the -version of the operating system that is currently running. - -Parameters - -lpVersionInfo - [in/out] Pointer to an OSVERSIONINFO data structure that the - function fills with operating system version information. - - Before calling the GetVersionEx function, set the - dwOSVersionInfoSize member of the OSVERSIONINFO data structure - to sizeof(OSVERSIONINFO). - -Return Values - -If the function succeeds, the return value is a nonzero value. - -If the function fails, the return value is zero. To get extended error -information, call GetLastError. The function fails if you specify an -invalid value for the dwOSVersionInfoSize member of the OSVERSIONINFO -structure. - ---*/ -BOOL -PALAPI -GetVersionExA( - IN OUT LPOSVERSIONINFOA lpVersionInformation) -{ - BOOL bRet = TRUE; - PERF_ENTRY(GetVersionExA); - ENTRY("GetVersionExA (lpVersionInformation=%p)\n", lpVersionInformation); - - if (lpVersionInformation->dwOSVersionInfoSize == sizeof(OSVERSIONINFOA)) - { - lpVersionInformation->dwMajorVersion = 5; /* same as WIN2000 */ - lpVersionInformation->dwMinorVersion = 0; /* same as WIN2000 */ - lpVersionInformation->dwBuildNumber = 0; - lpVersionInformation->dwPlatformId = VER_PLATFORM_UNIX; - lpVersionInformation->szCSDVersion[0] = '\0'; /* no service pack */ - } - else - { - SetLastError(ERROR_INVALID_PARAMETER); - bRet = FALSE; - } - LOGEXIT("GetVersionExA returning BOOL %d\n", bRet); - PERF_EXIT(GetVersionExA); - return bRet; -} - - -/*++ -Function: - GetVersionExW - -See GetVersionExA ---*/ -BOOL -PALAPI -GetVersionExW( - IN OUT LPOSVERSIONINFOW lpVersionInformation) -{ - BOOL bRet = TRUE; - - PERF_ENTRY(GetVersionExW); - ENTRY("GetVersionExW (lpVersionInformation=%p)\n", lpVersionInformation); - - if (lpVersionInformation->dwOSVersionInfoSize == sizeof(OSVERSIONINFOW)) - { - lpVersionInformation->dwMajorVersion = 5; /* same as WIN2000 */ - lpVersionInformation->dwMinorVersion = 0; /* same as WIN2000 */ - lpVersionInformation->dwBuildNumber = 0; - lpVersionInformation->dwPlatformId = VER_PLATFORM_UNIX; - lpVersionInformation->szCSDVersion[0] = '\0'; /* no service pack */ - } - else - { - SetLastError(ERROR_INVALID_PARAMETER); - bRet = FALSE; - } - LOGEXIT("GetVersionExW returning BOOL %d\n", bRet); - PERF_EXIT(GetVersionExW); - return bRet; -} diff --git a/src/pal/tests/palsuite/miscellaneous/GetVersionExA/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/GetVersionExA/CMakeLists.txt deleted file mode 100644 index f6aa0cb2d9..0000000000 --- a/src/pal/tests/palsuite/miscellaneous/GetVersionExA/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12.2) - -add_subdirectory(test1) - diff --git a/src/pal/tests/palsuite/miscellaneous/GetVersionExA/test1/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/GetVersionExA/test1/CMakeLists.txt deleted file mode 100644 index 1e512f3c2f..0000000000 --- a/src/pal/tests/palsuite/miscellaneous/GetVersionExA/test1/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12.2) - -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -set(SOURCES - test.cpp -) - -add_executable(paltest_getversionexa_test1 - ${SOURCES} -) - -add_dependencies(paltest_getversionexa_test1 coreclrpal) - -target_link_libraries(paltest_getversionexa_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/pal/tests/palsuite/miscellaneous/GetVersionExA/test1/test.cpp b/src/pal/tests/palsuite/miscellaneous/GetVersionExA/test1/test.cpp deleted file mode 100644 index 5dd20c6576..0000000000 --- a/src/pal/tests/palsuite/miscellaneous/GetVersionExA/test1/test.cpp +++ /dev/null @@ -1,83 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -/*============================================================ -** -** Source : test.c -** -** Purpose: Test for GetVersionExA() function -** -** -**=========================================================*/ - -#include <palsuite.h> - -int __cdecl main(int argc, char *argv[]) { - - OSVERSIONINFO TheVersionInfo; - OSVERSIONINFO* pVersionInfo = &TheVersionInfo; - - /* - * Initialize the PAL and return FAILURE if this fails - */ - - if(0 != (PAL_Initialize(argc, argv))) - { - return FAIL; - } - - - /* This needs to be done before using GetVersionEx */ - pVersionInfo->dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - - /* If GetVersionEx fails, then the test fails */ - if(GetVersionEx(pVersionInfo) == 0) - { - Fail("ERROR: The GetVersionEx function returned 0, which indicates " - "failure."); - } - - /* These values are fixed, ensure they're set properly */ - if(pVersionInfo->dwMajorVersion != 5) - { - Fail("ERROR: The fixed value of dwMajorVersion shoud be 5, " - "but is really %d.",pVersionInfo->dwMajorVersion); - } - - /* The minor version values for Win2k and XP are different - for Win2k minor version equals 0 and for XP minor version - equals 1. Both values are excepted here. */ - if((pVersionInfo->dwMinorVersion != 0) && - (pVersionInfo->dwMinorVersion != 1)) - { - Fail("ERROR: The fixed value of dwMinorVersion shoud be 0 or 1, " - "but is really %d.",pVersionInfo->dwMinorVersion); - } - if(pVersionInfo->dwBuildNumber_PAL_Undefined < 0) - { - Fail("ERROR: The value of dwBuildNumber shoud be at least 0, but " - "is really %d.",pVersionInfo->dwBuildNumber_PAL_Undefined); - } - -#if !WIN32 - /* Under BSD, the PlatformID should be UNIX and the Service Pack - version should be set to "". - */ - - if(pVersionInfo->dwPlatformId != VER_PLATFORM_UNIX || - pVersionInfo->szCSDVersion_PAL_Undefined[0] != 0) - { - Fail("ERROR: The dwPlatformId should be %d but is really %d. And the " - "szCSDVerion should be NULL.", - VER_PLATFORM_UNIX,pVersionInfo->dwPlatformId); - } -#endif - - - PAL_Terminate(); - return PASS; -} - - - diff --git a/src/pal/tests/palsuite/miscellaneous/GetVersionExA/test1/testinfo.dat b/src/pal/tests/palsuite/miscellaneous/GetVersionExA/test1/testinfo.dat deleted file mode 100644 index 1e9c570c60..0000000000 --- a/src/pal/tests/palsuite/miscellaneous/GetVersionExA/test1/testinfo.dat +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. -# See the LICENSE file in the project root for more information. - -Version = 1.0 -Section = Miscellaneous -Function = GetVersionExA -Name = Positive Test for GetVersionExA -TYPE = DEFAULT -EXE1 = test -Description -= Test that all the values in the OSVERSION structure are set properly -= for the current environment. - - - diff --git a/src/pal/tests/palsuite/miscellaneous/GetVersionExW/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/GetVersionExW/CMakeLists.txt deleted file mode 100644 index f6aa0cb2d9..0000000000 --- a/src/pal/tests/palsuite/miscellaneous/GetVersionExW/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12.2) - -add_subdirectory(test1) - diff --git a/src/pal/tests/palsuite/miscellaneous/GetVersionExW/test1/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/GetVersionExW/test1/CMakeLists.txt deleted file mode 100644 index 4ef820c479..0000000000 --- a/src/pal/tests/palsuite/miscellaneous/GetVersionExW/test1/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12.2) - -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -set(SOURCES - test.cpp -) - -add_executable(paltest_getversionexw_test1 - ${SOURCES} -) - -add_dependencies(paltest_getversionexw_test1 coreclrpal) - -target_link_libraries(paltest_getversionexw_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/pal/tests/palsuite/miscellaneous/GetVersionExW/test1/test.cpp b/src/pal/tests/palsuite/miscellaneous/GetVersionExW/test1/test.cpp deleted file mode 100644 index 69aae54bcf..0000000000 --- a/src/pal/tests/palsuite/miscellaneous/GetVersionExW/test1/test.cpp +++ /dev/null @@ -1,88 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -/*============================================================ -** -** Source : test.c -** -** Purpose: Test for GetVersionExW() function -** -** -**=========================================================*/ - -#define UNICODE - -#include <palsuite.h> - -int __cdecl main(int argc, char *argv[]) -{ - - OSVERSIONINFO TheVersionInfo; - OSVERSIONINFO* pVersionInfo = &TheVersionInfo; - - /* - * Initialize the PAL and return FAILURE if this fails - */ - - if(0 != (PAL_Initialize(argc, argv))) - { - return FAIL; - } - - /* This needs to be done before using GetVersionEx */ - pVersionInfo->dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - - /* If GetVersionEx fails, then the test fails */ - if(GetVersionEx(pVersionInfo) == 0) - { - Fail("ERROR: The GetVersionEx function returned 0, which indicates " - "failure."); - } - - /* These values are fixed, ensure they're set properly */ - if(pVersionInfo->dwMajorVersion != 5) - { - Fail("ERROR: The fixed value of dwMajorVersion shoud be 5, but is " - " really %d.",pVersionInfo->dwMajorVersion); - } - - /* The minor version values for Win2k and XP are different - for Win2k minor version equals 0 and for XP minor version - equals 1. Both values are excepted here. */ - if((pVersionInfo->dwMinorVersion != 0) && - (pVersionInfo->dwMinorVersion != 1)) - { - Fail("ERROR: The fixed value of dwMinorVersion shoud be 0 or 1, " - "but is really %d.",pVersionInfo->dwMinorVersion); - } - - if(pVersionInfo->dwBuildNumber_PAL_Undefined < 0) - { - Fail("ERROR: The value of dwBuildNumber shoud be at least 0, but is " - "really %d.",pVersionInfo->dwBuildNumber_PAL_Undefined); - } - -#if !WIN32 - - - /* Under BSD, the PlatformID should be UNIX and the Service Pack - version should be set to "". - */ - - if(pVersionInfo->dwPlatformId != VER_PLATFORM_UNIX || - pVersionInfo->szCSDVersion_PAL_Undefined[0] != 0) - { - Fail("ERROR: The dwPlatformId should be %d but is really %d. And the " - "szCSDVerion should be NULL.",VER_PLATFORM_UNIX, - pVersionInfo->dwPlatformId); - } -#endif - - - PAL_Terminate(); - return PASS; -} - - - diff --git a/src/pal/tests/palsuite/miscellaneous/GetVersionExW/test1/testinfo.dat b/src/pal/tests/palsuite/miscellaneous/GetVersionExW/test1/testinfo.dat deleted file mode 100644 index 7773245b3f..0000000000 --- a/src/pal/tests/palsuite/miscellaneous/GetVersionExW/test1/testinfo.dat +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. -# See the LICENSE file in the project root for more information. - -Version = 1.0 -Section = Miscellaneous -Function = GetVersionExW -Name = Positive Test for GetVersionExW -TYPE = DEFAULT -EXE1 = test -Description -= Test that all the values in the OSVERSION structure are set properly -= for the current environment. - - - diff --git a/src/pal/tests/palsuite/paltestlist_to_be_reviewed.txt b/src/pal/tests/palsuite/paltestlist_to_be_reviewed.txt index f7a293a69c..3f9469d254 100644 --- a/src/pal/tests/palsuite/paltestlist_to_be_reviewed.txt +++ b/src/pal/tests/palsuite/paltestlist_to_be_reviewed.txt @@ -144,8 +144,6 @@ miscellaneous/GetDateFormatW/GetDateFormatW_neg1/paltest_getdateformatw_getdatef miscellaneous/GetDateFormatW/GetDateFormatW_neg2/paltest_getdateformatw_getdateformatw_neg2 miscellaneous/GetDateFormatW/test1/paltest_getdateformatw_test1 miscellaneous/GetUserNameW/test1/paltest_getusernamew_test1 -miscellaneous/GetVersionExA/test1/paltest_getversionexa_test1 -miscellaneous/GetVersionExW/test1/paltest_getversionexw_test1 miscellaneous/InterLockedExchangeAdd/test1/paltest_interlockedexchangeadd_test1 miscellaneous/IsBadCodePtr/test1/paltest_isbadcodeptr_test1 miscellaneous/IsBadReadPtr/test1/paltest_isbadreadptr_test1 |