p2pool/tests/src/check_win7.py
SChernykh eb490d89c2
Some checks failed
C/C++ CI / build-openbsd (map[architecture:x86-64 host:ubuntu-latest name:openbsd version:7.4]) (push) Has been cancelled
clang-tidy / clang-tidy (push) Has been cancelled
CodeQL / Analyze (cpp) (push) Has been cancelled
C/C++ CI / build-alpine-static (map[arch:aarch64 branch:latest-stable flags:-ffunction-sections -Wno-error=inline -mfix-cortex-a53-835769 -mfix-cortex-a53-843419]) (push) Has been cancelled
C/C++ CI / build-alpine-static (map[arch:riscv64 branch:edge flags:-ffunction-sections -Wno-error=inline]) (push) Has been cancelled
C/C++ CI / build-windows-msbuild (map[grpc:OFF os:2019 rx:ON upnp:ON vs:Visual Studio 16 2019 vspath:C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise]) (push) Has been cancelled
C/C++ CI / build-alpine-static (map[arch:x86_64 branch:latest-stable flags:-ffunction-sections -Wno-error=inline]) (push) Has been cancelled
C/C++ CI / build-ubuntu (map[c:gcc-11 cpp:g++-11 flags: os:ubuntu-20.04]) (push) Has been cancelled
C/C++ CI / build-ubuntu (map[c:gcc-12 cpp:g++-12 flags: os:ubuntu-22.04]) (push) Has been cancelled
C/C++ CI / build-ubuntu (map[c:gcc-8 cpp:g++-8 flags: os:ubuntu-20.04]) (push) Has been cancelled
C/C++ CI / build-ubuntu-static-libs (map[flags:-fuse-linker-plugin -ffunction-sections -Wno-error=inline]) (push) Has been cancelled
C/C++ CI / build-ubuntu-aarch64 (map[flags:-fuse-linker-plugin -ffunction-sections -mfix-cortex-a53-835769 -mfix-cortex-a53-843419 os:ubuntu-20.04]) (push) Has been cancelled
C/C++ CI / build-ubuntu-aarch64 (map[flags:-fuse-linker-plugin -ffunction-sections -mfix-cortex-a53-835769 -mfix-cortex-a53-843419 os:ubuntu-22.04]) (push) Has been cancelled
C/C++ CI / build-windows-msys2 (map[c:clang cxx:clang++ flags:-fuse-ld=lld -Wno-unused-command-line-argument -Wno-nan-infinity-disabled]) (push) Has been cancelled
C/C++ CI / build-windows-msys2 (map[c:gcc cxx:g++ flags:-ffunction-sections -Wno-error=maybe-uninitialized -Wno-error=attributes]) (push) Has been cancelled
C/C++ CI / build-windows-msbuild (map[grpc:OFF os:2019 rx:OFF upnp:OFF vs:Visual Studio 16 2019 vspath:C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise]) (push) Has been cancelled
C/C++ CI / build-windows-msbuild (map[grpc:OFF os:2019 rx:OFF upnp:ON vs:Visual Studio 16 2019 vspath:C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise]) (push) Has been cancelled
C/C++ CI / build-windows-msbuild (map[grpc:ON os:2019 rx:ON upnp:ON vs:Visual Studio 16 2019 vspath:C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise]) (push) Has been cancelled
C/C++ CI / build-windows-msbuild (map[grpc:ON os:2022 rx:ON upnp:ON vs:Visual Studio 17 2022 vspath:C:\Program Files\Microsoft Visual Studio\2022\Enterprise]) (push) Has been cancelled
C/C++ CI / build-macos (push) Has been cancelled
C/C++ CI / build-macos-aarch64 (push) Has been cancelled
C/C++ CI / build-freebsd (map[architecture:x86-64 host:ubuntu-latest name:freebsd version:13.3]) (push) Has been cancelled
cppcheck / cppcheck-ubuntu (push) Has been cancelled
cppcheck / cppcheck-windows (push) Has been cancelled
Microsoft C++ Code Analysis / Analyze (push) Has been cancelled
source-snapshot / source-snapshot (push) Has been cancelled
Sync test (old) / sync-test-windows-debug-asan (push) Has been cancelled
Sync test (old) / sync-test-ubuntu-tsan (push) Has been cancelled
Sync test (old) / sync-test-ubuntu-msan (push) Has been cancelled
Sync test (old) / sync-test-ubuntu-ubsan (push) Has been cancelled
Sync test (old) / sync-test-ubuntu-asan (push) Has been cancelled
Sync test (old) / sync-test-macos (map[flags:-Og -ftrapv -target arm64-apple-macos-11 os:macos-14]) (push) Has been cancelled
Sync test (old) / sync-test-macos (map[flags:-Og -ftrapv os:macos-13]) (push) Has been cancelled
Sync test (old) / sync-test-windows-leaks (push) Has been cancelled
Sync test / sync-test-ubuntu-tsan (push) Has been cancelled
Sync test / sync-test-ubuntu-msan (push) Has been cancelled
Sync test / sync-test-ubuntu-ubsan (push) Has been cancelled
Sync test / sync-test-ubuntu-asan (push) Has been cancelled
Sync test / sync-test-macos (map[flags:-Og -ftrapv -target arm64-apple-macos-11 os:macos-14]) (push) Has been cancelled
Sync test / sync-test-macos (map[flags:-Og -ftrapv os:macos-13]) (push) Has been cancelled
Sync test / sync-test-windows-debug-asan (push) Has been cancelled
Sync test / sync-test-windows-leaks (push) Has been cancelled
Updated curl to 8.9.0
2024-07-24 09:38:57 +02:00

314 lines
7 KiB
Python

# This file is part of the Monero P2Pool <https://github.com/SChernykh/p2pool>
# Copyright (c) 2021-2024 SChernykh <https://github.com/SChernykh>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import sys
allowedAPIs = {
"getaddrinfo",
"freeaddrinfo",
"WSAPoll",
"WSACreateEvent",
"WSACloseEvent",
"WSARecvFrom",
"WSASend",
"WSARecv",
"WSADuplicateSocketW",
"WSASocketW",
"WSAIoctl",
"getnameinfo",
"WSASocketA",
"GetAdaptersAddresses",
"GetBestInterface",
"DnsFree",
"LoadLibraryExW",
"RtlPcToFileHeader",
"RtlUnwindEx",
"GetCPInfo",
"GetStringTypeW",
"GetDriveTypeW",
"DecodePointer",
"EncodePointer",
"FreeLibraryAndExitThread",
"SystemTimeToTzSpecificLocalTime",
"CreateThread",
"LCMapStringEx",
"ExitThread",
"GetModuleHandleExW",
"SetStdHandle",
"FlsFree",
"FlsSetValue",
"FlsGetValue",
"SetFilePointer",
"SetEndOfFile",
"UnmapViewOfFile",
"GetLastError",
"FlushViewOfFile",
"CreateFileA",
"CloseHandle",
"CreateFileMappingA",
"MapViewOfFile",
"FlushFileBuffers",
"GetStdHandle",
"WriteConsoleA",
"SetConsoleMode",
"GetConsoleMode",
"FormatMessageA",
"SetThreadPriority",
"GetCurrentThread",
"SetThreadPriorityBoost",
"IsDebuggerPresent",
"Sleep",
"RaiseException",
"InitializeCriticalSection",
"EnterCriticalSection",
"LeaveCriticalSection",
"DeleteCriticalSection",
"QueryPerformanceCounter",
"QueryPerformanceFrequency",
"GetTickCount",
"FreeLibrary",
"GetProcAddress",
"LoadLibraryA",
"SetHandleInformation",
"WaitForSingleObject",
"GetCurrentThreadId",
"TryEnterCriticalSection",
"GetCurrentProcessId",
"GetHandleInformation",
"SetLastError",
"CreateIoCompletionPort",
"GetQueuedCompletionStatusEx",
"InitializeSRWLock",
"ReleaseSRWLockExclusive",
"ReleaseSRWLockShared",
"AcquireSRWLockExclusive",
"AcquireSRWLockShared",
"InitOnceExecuteOnce",
"GetTickCount64",
"GetModuleHandleW",
"SetFileCompletionNotificationModes",
"WideCharToMultiByte",
"DuplicateHandle",
"TryAcquireSRWLockExclusive",
"TryAcquireSRWLockShared",
"InitializeConditionVariable",
"WakeConditionVariable",
"WakeAllConditionVariable",
"SleepConditionVariableCS",
"SetEvent",
"ReleaseSemaphore",
"CreateEventA",
"GetCurrentProcess",
"ResumeThread",
"TlsAlloc",
"TlsGetValue",
"TlsSetValue",
"TlsFree",
"GetNativeSystemInfo",
"CreateSemaphoreA",
"GetFileType",
"PostQueuedCompletionStatus",
"CreateFileW",
"ResetEvent",
"QueueUserWorkItem",
"GetFileAttributesExW",
"UnregisterWait",
"GetNumberOfConsoleInputEvents",
"ReadConsoleInputW",
"ReadConsoleW",
"WriteConsoleW",
"FillConsoleOutputCharacterW",
"FillConsoleOutputAttribute",
"GetConsoleCursorInfo",
"SetConsoleCursorInfo",
"GetConsoleScreenBufferInfo",
"SetConsoleCursorPosition",
"SetConsoleTextAttribute",
"WriteConsoleInputW",
"ReadFile",
"WriteFile",
"ConnectNamedPipe",
"SetNamedPipeHandleState",
"PeekNamedPipe",
"CreateNamedPipeW",
"CancelIoEx",
"CancelSynchronousIo",
"SwitchToThread",
"LocalFree",
"GetNamedPipeHandleStateA",
"GetNamedPipeClientProcessId",
"GetNamedPipeServerProcessId",
"MultiByteToWideChar",
"SetConsoleCtrlHandler",
"SetErrorMode",
"GetQueuedCompletionStatus",
"CreateDirectoryW",
"FindClose",
"FindFirstFileW",
"FindNextFileW",
"RtlUnwind",
"GetFileAttributesW",
"GetFileInformationByHandle",
"GetFileSizeEx",
"GetFinalPathNameByHandleW",
"GetFullPathNameW",
"RemoveDirectoryW",
"SetFilePointerEx",
"SetFileTime",
"DeviceIoControl",
"GetSystemInfo",
"GetSystemTimeAsFileTime",
"ReOpenFile",
"CopyFileW",
"MoveFileExW",
"CreateHardLinkW",
"GetFileInformationByHandleEx",
"CreateSymbolicLinkW",
"CancelIo",
"DebugBreak",
"GetCurrentDirectoryW",
"TerminateProcess",
"GetExitCodeProcess",
"UnregisterWaitEx",
"LCMapStringW",
"GetLongPathNameW",
"ReadDirectoryChangesW",
"GetEnvironmentStringsW",
"FreeEnvironmentStringsW",
"SetEnvironmentVariableW",
"GetModuleFileNameW",
"FileTimeToSystemTime",
"GetModuleHandleA",
"LoadLibraryExA",
"GetStartupInfoW",
"FormatMessageW",
"InitializeCriticalSectionEx",
"GetSystemDirectoryA",
"WaitForSingleObjectEx",
"GetEnvironmentVariableA",
"SleepEx",
"VerSetConditionMask",
"VerifyVersionInfoW",
"VirtualProtect",
"VirtualFree",
"VirtualAlloc",
"GetLargePageMinimum",
"HeapFree",
"HeapAlloc",
"GetProcessHeap",
"FlsAlloc",
"SleepConditionVariableSRW",
"GetExitCodeThread",
"InitializeSListHead",
"CreateEventW",
"InitializeCriticalSectionAndSpinCount",
"IsProcessorFeaturePresent",
"SetUnhandledExceptionFilter",
"UnhandledExceptionFilter",
"RtlVirtualUnwind",
"RtlLookupFunctionEntry",
"SetFileAttributesW",
"GetConsoleOutputCP",
"ExitProcess",
"GetCommandLineA",
"GetCommandLineW",
"GetDateFormatW",
"GetTimeFormatW",
"CompareStringW",
"GetLocaleInfoW",
"IsValidLocale",
"GetUserDefaultLCID",
"EnumSystemLocalesW",
"HeapReAlloc",
"HeapSize",
"FindFirstFileExW",
"IsValidCodePage",
"GetACP",
"GetOEMCP",
"GetTimeZoneInformation",
"RegisterWaitForSingleObject",
"GetDiskFreeSpaceW",
"RtlCaptureContext",
"GetMessageA",
"GetSystemMetrics",
"MapVirtualKeyW",
"DispatchMessageA",
"TranslateMessage",
"AdjustTokenPrivileges",
"LookupPrivilegeValueA",
"CryptDestroyHash",
"CryptHashData",
"CryptCreateHash",
"CryptGetHashParam",
"CryptReleaseContext",
"CryptAcquireContextA",
"SystemFunction036",
"OpenProcessToken",
"SetSecurityDescriptorDacl",
"InitializeSecurityDescriptor",
"BCryptGenRandom",
"GetConsoleCP",
"DeleteFileW",
"GetTempPathW",
"WSAConnect",
"WSAGetOverlappedResult",
"GetBestRoute2",
"FreeMibTable",
"GetUnicastIpAddressTable",
"SymFromAddr",
"RegEnumKeyExA",
"RegQueryValueExA",
"RegOpenKeyExA",
"RegGetValueA",
"RegCloseKey",
"GetLocaleInfoEx",
"ExpandEnvironmentStringsA",
"GetWindowsDirectoryA",
"GetVersionExA",
"LoadLibraryW",
"GetCurrentProcessorNumber",
"OutputDebugStringA",
"GetLogicalProcessorInformation",
"InitOnceComplete",
"InitOnceBeginInitialize",
"BCryptOpenAlgorithmProvider",
"BCryptCloseAlgorithmProvider",
"CertOpenSystemStoreW",
"CertEnumCertificatesInStore",
"CertCloseStore",
"CryptBinaryToStringW",
"DeleteFileA",
"GetFileAttributesA",
"OpenThreadToken",
}
f = open(sys.argv[1], 'r')
lines = f.readlines()
f.close()
exit_code = 0
count = 0
for line in lines:
count += 1
api = line[29:].strip()
if api not in allowedAPIs:
print('API call "{}" is not checked for Windows 7 compatibility. Check it and then add it to the list in tests/src/check_win7.py'.format(api))
exit_code = 1
if exit_code == 0:
print('{} imports checked successfully'.format(count))
sys.exit(exit_code)