Add files via upload
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
//+------------------------------------------------------------------+
|
||||
//| errhandlingapi.mqh |
|
||||
//| Copyright 2000-2024, MetaQuotes Ltd. |
|
||||
//| https://www.mql5.com |
|
||||
//+------------------------------------------------------------------+
|
||||
#include <WinAPI\windef.mqh>
|
||||
#include <WinAPI\winnt.mqh>
|
||||
//+------------------------------------------------------------------+
|
||||
//| |
|
||||
//+------------------------------------------------------------------+
|
||||
#import "kernel32.dll"
|
||||
void RaiseException(uint exception_code,uint exception_flags,uint number_of_arguments,const ulong &arguments[]);
|
||||
int UnhandledExceptionFilter(EXCEPTION_POINTERS &exception_info);
|
||||
PVOID SetUnhandledExceptionFilter(PVOID top_level_exception_filter);
|
||||
uint GetLastError(void);
|
||||
void SetLastError(uint err_code);
|
||||
uint GetErrorMode(void);
|
||||
uint SetErrorMode(uint mode);
|
||||
PVOID AddVectoredExceptionHandler(uint first,PVOID handler);
|
||||
uint RemoveVectoredExceptionHandler(PVOID handle);
|
||||
PVOID AddVectoredContinueHandler(uint first,PVOID handler);
|
||||
uint RemoveVectoredContinueHandler(PVOID handle);
|
||||
void RestoreLastError(uint err_code);
|
||||
void RaiseFailFastException(EXCEPTION_RECORD &exception_record,CONTEXT &context_record,uint flags);
|
||||
void FatalAppExitW(uint action,const string message_text);
|
||||
uint GetThreadErrorMode(void);
|
||||
int SetThreadErrorMode(uint new_mode,uint& old_mode);
|
||||
#import
|
||||
@@ -0,0 +1,146 @@
|
||||
//+------------------------------------------------------------------+
|
||||
//| fileapi.mqh |
|
||||
//| Copyright 2000-2024, MetaQuotes Ltd. |
|
||||
//| https://www.mql5.com |
|
||||
//+------------------------------------------------------------------+
|
||||
#include <WinAPI\windef.mqh>
|
||||
|
||||
//---
|
||||
enum STREAM_INFO_LEVELS
|
||||
{
|
||||
FindStreamInfoStandard,
|
||||
FindStreamInfoMaxInfoLevel
|
||||
};
|
||||
//---
|
||||
struct BY_HANDLE_FILE_INFORMATION
|
||||
{
|
||||
uint dwFileAttributes;
|
||||
FILETIME ftCreationTime;
|
||||
FILETIME ftLastAccessTime;
|
||||
FILETIME ftLastWriteTime;
|
||||
uint dwVolumeSerialNumber;
|
||||
uint nFileSizeHigh;
|
||||
uint nFileSizeLow;
|
||||
uint nNumberOfLinks;
|
||||
uint nFileIndexHigh;
|
||||
uint nFileIndexLow;
|
||||
};
|
||||
//---
|
||||
struct CREATEFILE2_EXTENDED_PARAMETERS
|
||||
{
|
||||
uint dwSize;
|
||||
uint dwFileAttributes;
|
||||
uint dwFileFlags;
|
||||
uint dwSecurityQosFlags;
|
||||
PVOID lpSecurityAttributes;
|
||||
HANDLE hTemplateFile;
|
||||
};
|
||||
//---
|
||||
struct FILE_ATTRIBUTE_DATA
|
||||
{
|
||||
uint dwFileAttributes;
|
||||
FILETIME ftCreationTime;
|
||||
FILETIME ftLastAccessTime;
|
||||
FILETIME ftLastWriteTime;
|
||||
uint nFileSizeHigh;
|
||||
uint nFileSizeLow;
|
||||
};
|
||||
//---
|
||||
struct FIND_STREAM_DATA
|
||||
{
|
||||
long StreamSize;
|
||||
short cStreamName[MAX_PATH+36];
|
||||
};
|
||||
//---
|
||||
struct FIND_DATAW
|
||||
{
|
||||
uint dwFileAttributes;
|
||||
FILETIME ftCreationTime;
|
||||
FILETIME ftLastAccessTime;
|
||||
FILETIME ftLastWriteTime;
|
||||
uint nFileSizeHigh;
|
||||
uint nFileSizeLow;
|
||||
uint dwReserved0;
|
||||
uint dwReserved1;
|
||||
short cFileName[MAX_PATH];
|
||||
short cAlternateFileName[14];
|
||||
};
|
||||
//+------------------------------------------------------------------+
|
||||
//| |
|
||||
//+------------------------------------------------------------------+
|
||||
#import "kernel32.dll"
|
||||
int AreFileApisANSI(void);
|
||||
int CompareFileTime(FILETIME &file_time1,FILETIME &file_time2);
|
||||
int CreateDirectoryW(const string path_name,PVOID security_attributes);
|
||||
HANDLE CreateFile2(const string file_name,uint desired_access,uint share_mode,uint creation_disposition,CREATEFILE2_EXTENDED_PARAMETERS &create_ex_params);
|
||||
HANDLE CreateFileW(const string file_name,uint desired_access,uint share_mode,PVOID security_attributes,uint creation_disposition,uint flags_and_attributes,HANDLE template_file);
|
||||
int DefineDosDeviceW(uint flags,const string device_name,const string target_path);
|
||||
int DeleteFileW(const string file_name);
|
||||
int DeleteVolumeMountPointW(const string volume_mount_point);
|
||||
int FileTimeToLocalFileTime(FILETIME &file_time,FILETIME &local_file_time);
|
||||
int FindClose(HANDLE find_file);
|
||||
int FindCloseChangeNotification(HANDLE change_handle);
|
||||
HANDLE FindFirstChangeNotificationW(const string path_name,int watch_subtree,uint notify_filter);
|
||||
HANDLE FindFirstFileExW(const string file_name,FINDEX_INFO_LEVELS info_level_id,FIND_DATAW &find_file_data,FINDEX_SEARCH_OPS search_op,PVOID search_filter,uint additional_flags);
|
||||
HANDLE FindFirstFileNameW(const string file_name,uint flags,uint &StringLength,ushort &LinkName[]);
|
||||
HANDLE FindFirstFileW(const string file_name,FIND_DATAW &find_file_data);
|
||||
HANDLE FindFirstStreamW(const string file_name,STREAM_INFO_LEVELS InfoLevel,FIND_STREAM_DATA &find_stream_data,uint flags);
|
||||
HANDLE FindFirstVolumeW(ushort &volume_name[],uint &buffer_length);
|
||||
int FindNextChangeNotification(HANDLE change_handle);
|
||||
int FindNextFileNameW(HANDLE find_stream,uint &StringLength,ushort &LinkName[]);
|
||||
int FindNextFileW(HANDLE find_file,FIND_DATAW &find_file_data);
|
||||
int FindNextStreamW(HANDLE find_stream,FIND_STREAM_DATA &find_stream_data);
|
||||
int FindNextVolumeW(HANDLE find_volume,ushort &volume_name[],uint &buffer_length);
|
||||
int FindVolumeClose(HANDLE find_volume);
|
||||
int FlushFileBuffers(HANDLE file);
|
||||
uint GetCompressedFileSizeW(const string file_name,uint &file_size_high);
|
||||
int GetDiskFreeSpaceExW(const string directory_name,ulong &free_bytes_available_to_caller,ulong &total_number_of_bytes,ulong &total_number_of_free_bytes);
|
||||
int GetDiskFreeSpaceW(const string root_path_name,uint §ors_per_cluster,uint &bytes_per_sector,uint &number_of_free_clusters,uint &total_number_of_clusters);
|
||||
uint GetDriveTypeW(const string root_path_name);
|
||||
int GetFileAttributesExW(const string file_name,GET_FILEEX_INFO_LEVELS info_level_id,FILE_ATTRIBUTE_DATA &file_information);
|
||||
uint GetFileAttributesW(const string file_name);
|
||||
int GetFileInformationByHandle(HANDLE file,BY_HANDLE_FILE_INFORMATION &file_information);
|
||||
uint GetFileSize(HANDLE file,uint &file_size_high);
|
||||
int GetFileSizeEx(HANDLE file,long &file_size);
|
||||
int GetFileTime(HANDLE file,FILETIME &creation_time,FILETIME &last_access_time,FILETIME &last_write_time);
|
||||
uint GetFileType(HANDLE file);
|
||||
uint GetFinalPathNameByHandleW(HANDLE file,ushort &file_path[],uint file_path,uint flags);
|
||||
uint GetFullPathNameW(const string file_name,uint buffer_length,ushort &buffer[],ushort &file_part[]);
|
||||
uint GetLogicalDrives(void);
|
||||
uint GetLogicalDriveStringsW(uint buffer_length,ushort &buffer[]);
|
||||
uint GetLongPathNameW(const string short_path,string &long_path,uint buffer);
|
||||
uint GetShortPathNameW(const string long_path,string &short_path,uint buffer);
|
||||
uint GetTempFileNameW(const string path_name,const string prefix_string,uint unique,ushort &temp_file_name[]);
|
||||
uint GetTempPathW(uint buffer_length,ushort &buffer[]);
|
||||
int GetVolumeInformationByHandleW(HANDLE file,ushort &volume_name_buffer[],uint volume_name_size,uint &volume_serial_number,uint &maximum_component_length,uint &file_system_flags,ushort &file_system_name_buffer[],uint file_system_name_size);
|
||||
int GetVolumeInformationW(const string root_path_name,ushort &volume_name_buffer[],uint volume_name_size,uint &volume_serial_number,uint &maximum_component_length,uint &file_system_flags,ushort &file_system_name_buffer[],uint file_system_name_size);
|
||||
int GetVolumeNameForVolumeMountPointW(const string volume_mount_point,string volume_name,uint buffer_length);
|
||||
int GetVolumePathNamesForVolumeNameW(const string volume_name,string volume_path_names,uint buffer_length,uint &return_length);
|
||||
int GetVolumePathNameW(const string file_name,ushort &volume_path_name[],uint buffer_length);
|
||||
int LocalFileTimeToFileTime(FILETIME &local_file_time,FILETIME &file_time);
|
||||
int LockFile(HANDLE file,uint file_offset_low,uint file_offset_high,uint number_of_bytes_to_lock_low,uint number_of_bytes_to_lock_high);
|
||||
int LockFileEx(HANDLE file,uint flags,uint reserved,uint number_of_bytes_to_lock_low,uint number_of_bytes_to_lock_high,OVERLAPPED &overlapped);
|
||||
uint QueryDosDeviceW(const string device_name,ushort &target_path[],uint max);
|
||||
int ReadFile(HANDLE file,ushort &buffer[],uint number_of_bytes_to_read,uint &number_of_bytes_read,OVERLAPPED &overlapped);
|
||||
int ReadFile(HANDLE file,ushort &buffer[],uint number_of_bytes_to_read,uint &number_of_bytes_read,PVOID overlapped);
|
||||
int ReadFileScatter(HANDLE file,FILE_SEGMENT_ELEMENT &segment_array[],uint number_of_bytes_to_read,uint &reserved,OVERLAPPED &overlapped);
|
||||
int ReadFileScatter(HANDLE file,FILE_SEGMENT_ELEMENT &segment_array[],uint number_of_bytes_to_read,uint &reserved,PVOID overlapped);
|
||||
int RemoveDirectoryW(const string path_name);
|
||||
int SetEndOfFile(HANDLE file);
|
||||
void SetFileApisToANSI(void);
|
||||
void SetFileApisToOEM(void);
|
||||
int SetFileAttributesW(const string file_name,uint file_attributes);
|
||||
int SetFileInformationByHandle(HANDLE file,FILE_INFO_BY_HANDLE_CLASS FileInformationClass,FILE_INFO &file_information,uint buffer_size);
|
||||
int SetFileIoOverlappedRange(HANDLE FileHandle,uchar &OverlappedRangeStart,uint Length);
|
||||
uint SetFilePointer(HANDLE file,long distance_to_move,long &distance_to_move_high,uint move_method);
|
||||
int SetFilePointerEx(HANDLE file,long distance_to_move,long &new_file_pointer,uint move_method);
|
||||
int SetFileTime(HANDLE file,FILETIME &creation_time,FILETIME &last_access_time,FILETIME &last_write_time);
|
||||
int SetFileValidData(HANDLE file,long ValidDataLength);
|
||||
int UnlockFile(HANDLE file,uint file_offset_low,uint file_offset_high,uint number_of_bytes_to_unlock_low,uint number_of_bytes_to_unlock_high);
|
||||
int UnlockFileEx(HANDLE file,uint reserved,uint number_of_bytes_to_unlock_low,uint number_of_bytes_to_unlock_high,OVERLAPPED &overlapped);
|
||||
int WriteFile(HANDLE file,const ushort &buffer[],uint number_of_bytes_to_write,uint &number_of_bytes_written,OVERLAPPED &overlapped);
|
||||
int WriteFile(HANDLE file,const ushort &buffer[],uint number_of_bytes_to_write,uint &number_of_bytes_written,PVOID overlapped);
|
||||
int WriteFileGather(HANDLE file,FILE_SEGMENT_ELEMENT &segment_array[],uint number_of_bytes_to_write,uint &reserved,OVERLAPPED &overlapped);
|
||||
int WriteFileGather(HANDLE file,FILE_SEGMENT_ELEMENT &segment_array[],uint number_of_bytes_to_write,uint &reserved,PVOID overlapped);
|
||||
#import
|
||||
//+------------------------------------------------------------------+
|
||||
@@ -0,0 +1,21 @@
|
||||
//+------------------------------------------------------------------+
|
||||
//| handleapi.mqh |
|
||||
//| Copyright 2000-2024, MetaQuotes Ltd. |
|
||||
//| https://www.mql5.com |
|
||||
//+------------------------------------------------------------------+
|
||||
#include <WinAPI\windef.mqh>
|
||||
|
||||
//+------------------------------------------------------------------+
|
||||
//| |
|
||||
//+------------------------------------------------------------------+
|
||||
#import "kernel32.dll"
|
||||
int CloseHandle(HANDLE object);
|
||||
int DuplicateHandle(HANDLE source_process_handle,HANDLE source_handle,HANDLE target_process_handle,HANDLE &target_handle,uint desired_access,int inherit_handle,uint options);
|
||||
int GetHandleInformation(HANDLE object,uint& flags);
|
||||
int SetHandleInformation(HANDLE object,uint mask,uint flags);
|
||||
#import
|
||||
|
||||
#import "kernelbase.dll"
|
||||
int CompareObjectHandles(HANDLE first_object_handle, HANDLE second_object_handle);
|
||||
#import
|
||||
//+------------------------------------------------------------------+
|
||||
@@ -0,0 +1,47 @@
|
||||
//+------------------------------------------------------------------+
|
||||
//| libloaderapi.mqh |
|
||||
//| Copyright 2000-2024, MetaQuotes Ltd. |
|
||||
//| https://www.mql5.com |
|
||||
//+------------------------------------------------------------------+
|
||||
#include <WinAPI\windef.mqh>
|
||||
|
||||
//---
|
||||
struct ENUMUILANG
|
||||
{
|
||||
uint NumOfEnumUILang;
|
||||
uint SizeOfEnumUIBuffer;
|
||||
PVOID EnumUIBuffer;
|
||||
};
|
||||
//+------------------------------------------------------------------+
|
||||
//| |
|
||||
//+------------------------------------------------------------------+
|
||||
#import "kernel32.dll"
|
||||
int DisableThreadLibraryCalls(HANDLE lib_module);
|
||||
HANDLE FindResourceExW(HANDLE module,const string type,const string name,ushort language);
|
||||
int FindStringOrdinal(uint find_string_ordinal_flags,const string string_source,int source,const string string_value,int value,int ignore_case);
|
||||
int FreeLibrary(HANDLE lib_module);
|
||||
void FreeLibraryAndExitThread(HANDLE lib_module,uint exit_code);
|
||||
int FreeResource(HANDLE res_data);
|
||||
uint GetModuleFileNameW(HANDLE module,ushort &filename[],uint size);
|
||||
HANDLE GetModuleHandleW(const string module_name);
|
||||
int GetModuleHandleExW(uint flags,const string module_name,HANDLE &module);
|
||||
PVOID GetProcAddress(HANDLE module,uchar &proc_name[]);
|
||||
HANDLE LoadLibraryExW(const string lib_file_name,HANDLE file,uint flags);
|
||||
HANDLE LoadResource(HANDLE module,HANDLE res_info);
|
||||
PVOID LockResource(HANDLE res_data);
|
||||
uint SizeofResource(HANDLE module,HANDLE res_info);
|
||||
PVOID AddDllDirectory(const string new_directory);
|
||||
int RemoveDllDirectory(PVOID cookie);
|
||||
int SetDefaultDllDirectories(uint directory_flags);
|
||||
int EnumResourceLanguagesExW(HANDLE module,const string type,const string name,PVOID enum_func,long param,uint flags,ushort lang_id);
|
||||
int EnumResourceNamesExW(HANDLE module,const string type,PVOID enum_func,long param,uint flags,ushort lang_id);
|
||||
int EnumResourceTypesExW(HANDLE module,PVOID enum_func,long param,uint flags,ushort lang_id);
|
||||
HANDLE FindResourceW(HANDLE module,const string name,const string type);
|
||||
HANDLE LoadLibraryW(const string lib_file_name);
|
||||
int EnumResourceNamesW(HANDLE module,const string type,PVOID enum_func,long param);
|
||||
#import
|
||||
|
||||
#import "user32.dll"
|
||||
int LoadStringW(HANDLE instance,uint id,string buffer,int buffer_max);
|
||||
#import
|
||||
//+------------------------------------------------------------------+
|
||||
@@ -0,0 +1,85 @@
|
||||
//+------------------------------------------------------------------+
|
||||
//| memoryapi.mqh |
|
||||
//| Copyright 2000-2024, MetaQuotes Ltd. |
|
||||
//| https://www.mql5.com |
|
||||
//+------------------------------------------------------------------+
|
||||
#include <WinAPI\windef.mqh>
|
||||
#include <WinAPI\winnt.mqh>
|
||||
|
||||
//---
|
||||
enum MEMORY_RESOURCE_NOTIFICATION_TYPE
|
||||
{
|
||||
LowMemoryResourceNotification,
|
||||
HighMemoryResourceNotification
|
||||
};
|
||||
//---
|
||||
enum OFFER_PRIORITY
|
||||
{
|
||||
VmOfferPriorityVeryLow=1,
|
||||
VmOfferPriorityLow,
|
||||
VmOfferPriorityBelowNormal,
|
||||
VmOfferPriorityNormal
|
||||
};
|
||||
//---
|
||||
enum WIN32_MEMORY_INFORMATION_CLASS
|
||||
{
|
||||
MemoryRegionInfo
|
||||
};
|
||||
//---
|
||||
struct WIN32_MEMORY_RANGE_ENTRY
|
||||
{
|
||||
PVOID VirtualAddress;
|
||||
ulong NumberOfBytes;
|
||||
};
|
||||
//+------------------------------------------------------------------+
|
||||
//| |
|
||||
//+------------------------------------------------------------------+
|
||||
#import "kernel32.dll"
|
||||
int AllocateUserPhysicalPages(HANDLE hProcess,ulong &NumberOfPages,ulong &PageArray[]);
|
||||
int AllocateUserPhysicalPagesNuma(HANDLE hProcess,ulong &NumberOfPages,ulong &PageArray[],uint nndPreferred);
|
||||
HANDLE CreateFileMappingFromApp(HANDLE hFile,PVOID SecurityAttributes,uint PageProtection,ulong MaximumSize,const string Name);
|
||||
HANDLE CreateFileMappingNumaW(HANDLE hFile,PVOID lpFileMappingAttributes,uint flProtect,uint dwMaximumSizeHigh,uint dwMaximumSizeLow,const string lpName,uint nndPreferred);
|
||||
HANDLE CreateFileMappingW(HANDLE hFile,PVOID lpFileMappingAttributes,uint flProtect,uint dwMaximumSizeHigh,uint dwMaximumSizeLow,const string lpName);
|
||||
HANDLE CreateMemoryResourceNotification(MEMORY_RESOURCE_NOTIFICATION_TYPE NotificationType);
|
||||
uint DiscardVirtualMemory(PVOID VirtualAddress,ulong Size);
|
||||
int FlushViewOfFile(const PVOID lpBaseAddress,ulong dwNumberOfBytesToFlush);
|
||||
int FreeUserPhysicalPages(HANDLE hProcess,ulong &NumberOfPages,ulong &PageArray[]);
|
||||
ulong GetLargePageMinimum(void);
|
||||
int GetMemoryErrorHandlingCapabilities(uint &Capabilities);
|
||||
int GetProcessWorkingSetSizeEx(HANDLE hProcess,ulong &lpMinimumWorkingSetSize,ulong &lpMaximumWorkingSetSize,uint &Flags);
|
||||
int GetSystemFileCacheSize(ulong &lpMinimumFileCacheSize,ulong &lpMaximumFileCacheSize,uint &lpFlags);
|
||||
uint GetWriteWatch(uint dwFlags,PVOID lpBaseAddress,ulong dwRegionSize,PVOID &lpAddresses[],uint &lpdwCount,uint &lpdwGranularity);
|
||||
int MapUserPhysicalPages(PVOID VirtualAddress,ulong &NumberOfPages,ulong &PageArray[]);
|
||||
PVOID MapViewOfFile(HANDLE hFileMappingObject,uint dwDesiredAccess,uint dwFileOffsetHigh,uint dwFileOffsetLow,ulong dwNumberOfBytesToMap);
|
||||
PVOID MapViewOfFileEx(HANDLE hFileMappingObject,uint dwDesiredAccess,uint dwFileOffsetHigh,uint dwFileOffsetLow,ulong dwNumberOfBytesToMap,PVOID lpBaseAddress);
|
||||
PVOID MapViewOfFileFromApp(HANDLE hFileMappingObject,uint DesiredAccess,ulong FileOffset,ulong NumberOfBytesToMap);
|
||||
uint OfferVirtualMemory(PVOID VirtualAddress,ulong Size,OFFER_PRIORITY Priority);
|
||||
HANDLE OpenFileMappingW(uint dwDesiredAccess,int bInheritHandle,const string lpName);
|
||||
int PrefetchVirtualMemory(HANDLE hProcess,uint &NumberOfEntries,WIN32_MEMORY_RANGE_ENTRY &VirtualAddresses,uint Flags);
|
||||
int QueryMemoryResourceNotification(HANDLE ResourceNotificationHandle,int &ResourceState);
|
||||
int ReadProcessMemory(HANDLE hProcess,const PVOID lpBaseAddress,PVOID lpBuffer,ulong nSize,ulong &lpNumberOfBytesRead);
|
||||
uint ReclaimVirtualMemory(const PVOID VirtualAddress,ulong Size);
|
||||
PVOID RegisterBadMemoryNotification(PVOID Callback);
|
||||
uint ResetWriteWatch(PVOID lpBaseAddress,ulong dwRegionSize);
|
||||
int SetProcessWorkingSetSizeEx(HANDLE hProcess,ulong dwMinimumWorkingSetSize,ulong dwMaximumWorkingSetSize,uint Flags);
|
||||
int SetSystemFileCacheSize(ulong MinimumFileCacheSize,ulong MaximumFileCacheSize,uint Flags);
|
||||
int UnmapViewOfFile(const PVOID lpBaseAddress);
|
||||
int UnmapViewOfFileEx(PVOID BaseAddress,uint UnmapFlags);
|
||||
int UnregisterBadMemoryNotification(PVOID RegistrationHandle);
|
||||
PVOID VirtualAlloc(PVOID lpAddress,ulong dwSize,uint flAllocationType,uint flProtect);
|
||||
PVOID VirtualAllocEx(HANDLE hProcess,PVOID lpAddress,ulong dwSize,uint flAllocationType,uint flProtect);
|
||||
PVOID VirtualAllocExNuma(HANDLE hProcess,PVOID lpAddress,ulong dwSize,uint flAllocationType,uint flProtect,uint nndPreferred);
|
||||
int VirtualFree(PVOID lpAddress,ulong dwSize,uint dwFreeType);
|
||||
int VirtualFreeEx(HANDLE hProcess,PVOID lpAddress,ulong dwSize,uint dwFreeType);
|
||||
int VirtualLock(PVOID lpAddress,ulong dwSize);
|
||||
int VirtualProtect(PVOID lpAddress,ulong dwSize,uint flNewProtect,uint &lpflOldProtect);
|
||||
int VirtualProtectEx(HANDLE hProcess,PVOID lpAddress,ulong dwSize,uint flNewProtect,uint &lpflOldProtect);
|
||||
ulong VirtualQuery(const PVOID lpAddress,MEMORY_BASIC_INFORMATION &lpBuffer,ulong dwLength);
|
||||
ulong VirtualQueryEx(HANDLE hProcess,const PVOID lpAddress,MEMORY_BASIC_INFORMATION &lpBuffer,ulong dwLength);
|
||||
int VirtualUnlock(PVOID lpAddress,ulong dwSize);
|
||||
int WriteProcessMemory(HANDLE hProcess,PVOID lpBaseAddress,PVOID lpBuffer,ulong nSize,ulong &lpNumberOfBytesWritten);
|
||||
int WriteProcessMemory(HANDLE hProcess,PVOID lpBaseAddress,uchar &lpBuffer[],ulong nSize,ulong &lpNumberOfBytesWritten);
|
||||
int WriteProcessMemory(HANDLE hProcess,uchar &lpBaseAddress[],PVOID lpBuffer,ulong nSize,ulong &lpNumberOfBytesWritten);
|
||||
int WriteProcessMemory(HANDLE hProcess,uchar &lpBaseAddress[],uchar &lpBuffer[],ulong nSize,ulong &lpNumberOfBytesWritten);
|
||||
#import
|
||||
//+------------------------------------------------------------------+
|
||||
@@ -0,0 +1,27 @@
|
||||
//+------------------------------------------------------------------+
|
||||
//| processenv.mqh |
|
||||
//| Copyright 2000-2024, MetaQuotes Ltd. |
|
||||
//| https://www.mql5.com |
|
||||
//+------------------------------------------------------------------+
|
||||
#include <WinAPI\windef.mqh>
|
||||
|
||||
//+------------------------------------------------------------------+
|
||||
//| |
|
||||
//+------------------------------------------------------------------+
|
||||
#import "kernel32.dll"
|
||||
int SetEnvironmentStringsW(string new_environment);
|
||||
HANDLE GetStdHandle(uint std_handle);
|
||||
int SetStdHandle(uint std_handle,HANDLE handle);
|
||||
int SetStdHandleEx(uint std_handle,HANDLE handle,HANDLE &prev_value);
|
||||
string GetCommandLineW(void);
|
||||
string GetEnvironmentStringsW(void);
|
||||
int FreeEnvironmentStringsW(string v);
|
||||
uint GetEnvironmentVariableW(const string name,ushort &buffer[],uint size);
|
||||
int SetEnvironmentVariableW(const string name,const string value);
|
||||
uint ExpandEnvironmentStringsW(const string src,string dst,uint size);
|
||||
int SetCurrentDirectoryW(const string path_name);
|
||||
uint GetCurrentDirectoryW(uint buffer_length,ushort &buffer[]);
|
||||
uint GetCurrentDirectoryW(uint buffer_length,string &buffer);
|
||||
uint SearchPathW(const string path,const string file_name,const string extension,uint buffer_length,ushort &buffer[],string &file_part);
|
||||
int NeedCurrentDirectoryForExePathW(const string exe_name);
|
||||
#import
|
||||
@@ -0,0 +1,202 @@
|
||||
//+------------------------------------------------------------------+
|
||||
//| processthreadsapi.mqh |
|
||||
//| Copyright 2000-2024, MetaQuotes Ltd. |
|
||||
//| https://www.mql5.com |
|
||||
//+------------------------------------------------------------------+
|
||||
#include <WinAPI\windef.mqh>
|
||||
#include <WinAPI\winnt.mqh>
|
||||
|
||||
//+------------------------------------------------------------------+
|
||||
//| |
|
||||
//+------------------------------------------------------------------+
|
||||
//---
|
||||
enum THREAD_INFORMATION_CLASS
|
||||
{
|
||||
ThreadMemoryPriority,
|
||||
ThreadAbsoluteCpuPriority,
|
||||
ThreadDynamicCodePolicy,
|
||||
ThreadPowerThrottling,
|
||||
ThreadInformationClassMax
|
||||
};
|
||||
//---
|
||||
enum PROCESS_INFORMATION_CLASS
|
||||
{
|
||||
ProcessMemoryPriority,
|
||||
ProcessMemoryExhaustionInfo,
|
||||
ProcessAppMemoryInfo,
|
||||
ProcessInPrivateInfo,
|
||||
ProcessPowerThrottling,
|
||||
ProcessReservedValue1,
|
||||
ProcessTelemetryCoverageInfo,
|
||||
ProcessProtectionLevelInfo,
|
||||
ProcessInformationClassMax
|
||||
};
|
||||
//---
|
||||
enum PROCESS_MEMORY_EXHAUSTION_TYPE
|
||||
{
|
||||
PMETypeFailFastOnCommitFailure,
|
||||
PMETypeMax
|
||||
};
|
||||
//+------------------------------------------------------------------+
|
||||
//| |
|
||||
//+------------------------------------------------------------------+
|
||||
//---
|
||||
struct PROCESS_INFORMATION
|
||||
{
|
||||
HANDLE hProcess;
|
||||
HANDLE hThread;
|
||||
uint dwProcessId;
|
||||
uint dwThreadId;
|
||||
};
|
||||
//---
|
||||
struct STARTUPINFOW
|
||||
{
|
||||
uint cb;
|
||||
string lpReserved;
|
||||
string lpDesktop;
|
||||
string lpTitle;
|
||||
uint dwX;
|
||||
uint dwY;
|
||||
uint dwXSize;
|
||||
uint dwYSize;
|
||||
uint dwXCountChars;
|
||||
uint dwYCountChars;
|
||||
uint dwFillAttribute;
|
||||
uint dwFlags;
|
||||
ushort wShowWindow;
|
||||
ushort cbReserved2;
|
||||
PVOID lpReserved2;
|
||||
HANDLE hStdInput;
|
||||
HANDLE hStdOutput;
|
||||
HANDLE hStdError;
|
||||
};
|
||||
//---
|
||||
struct MEMORY_PRIORITY_INFORMATION
|
||||
{
|
||||
uint MemoryPriority;
|
||||
};
|
||||
//---
|
||||
struct THREAD_POWER_THROTTLING_STATE
|
||||
{
|
||||
uint Version;
|
||||
uint ControlMask;
|
||||
uint StateMask;
|
||||
};
|
||||
//---
|
||||
struct APP_MEMORY_INFORMATION
|
||||
{
|
||||
ulong AvailableCommit;
|
||||
ulong PrivateCommitUsage;
|
||||
ulong PeakPrivateCommitUsage;
|
||||
ulong TotalCommitUsage;
|
||||
};
|
||||
//---
|
||||
struct PROCESS_MEMORY_EXHAUSTION_INFO
|
||||
{
|
||||
ushort Version;
|
||||
ushort Reserved;
|
||||
PROCESS_MEMORY_EXHAUSTION_TYPE Type;
|
||||
ulong Value;
|
||||
};
|
||||
//---
|
||||
struct PROCESS_POWER_THROTTLING_STATE
|
||||
{
|
||||
uint Version;
|
||||
uint ControlMask;
|
||||
uint StateMask;
|
||||
};
|
||||
//---
|
||||
struct PROCESS_PROTECTION_LEVEL_INFORMATION
|
||||
{
|
||||
uint ProtectionLevel;
|
||||
};
|
||||
//+------------------------------------------------------------------+
|
||||
//| |
|
||||
//+------------------------------------------------------------------+
|
||||
#import "kernel32.dll"
|
||||
uint QueueUserAPC(PVOID apc,HANDLE thread,ulong data);
|
||||
int GetProcessTimes(HANDLE process,FILETIME &creation_time,FILETIME &exit_time,FILETIME &kernel_time,FILETIME &user_time);
|
||||
HANDLE GetCurrentProcess(void);
|
||||
uint GetCurrentProcessId(void);
|
||||
void ExitProcess(uint exit_code);
|
||||
int TerminateProcess(HANDLE process,uint exit_code);
|
||||
int GetExitCodeProcess(HANDLE process,uint &exit_code);
|
||||
int SwitchToThread(void);
|
||||
HANDLE CreateThread(PVOID thread_attributes,ulong stack_size,PVOID start_address,PVOID parameter,uint creation_flags,uint &thread_id);
|
||||
HANDLE CreateRemoteThread(HANDLE process,PVOID thread_attributes,ulong stack_size,PVOID start_address,PVOID parameter,uint creation_flags,uint &thread_id);
|
||||
HANDLE GetCurrentThread(void);
|
||||
uint GetCurrentThreadId(void);
|
||||
HANDLE OpenThread(uint desired_access,int inherit_handle,uint thread_id);
|
||||
int SetThreadPriority(HANDLE thread,int priority);
|
||||
int SetThreadPriorityBoost(HANDLE thread,int disable_priority_boost);
|
||||
int GetThreadPriorityBoost(HANDLE thread,int &disable_priority_boost);
|
||||
int GetThreadPriority(HANDLE thread);
|
||||
void ExitThread(uint exit_code);
|
||||
int TerminateThread(HANDLE thread,uint exit_code);
|
||||
int GetExitCodeThread(HANDLE thread,uint &exit_code);
|
||||
uint SuspendThread(HANDLE thread);
|
||||
uint ResumeThread(HANDLE thread);
|
||||
uint TlsAlloc(void);
|
||||
PVOID TlsGetValue(uint tls_index);
|
||||
int TlsSetValue(uint tls_index,PVOID tls_value);
|
||||
int TlsFree(uint tls_index);
|
||||
int CreateProcessW(const string application_name,string command_line,PVOID process_attributes,PVOID thread_attributes,int inherit_handles,uint creation_flags,PVOID environment,const string current_directory,STARTUPINFOW &startup_info,PROCESS_INFORMATION &process_information);
|
||||
int SetProcessShutdownParameters(uint level,uint flags);
|
||||
uint GetProcessVersion(uint process_id);
|
||||
void GetStartupInfoW(STARTUPINFOW &startup_info);
|
||||
int SetPriorityClass(HANDLE process,uint priority_class);
|
||||
uint GetPriorityClass(HANDLE process);
|
||||
int SetThreadStackGuarantee(ulong stack_size_in_bytes);
|
||||
int ProcessIdToSessionId(uint process_id,uint &session_id);
|
||||
uint GetProcessId(HANDLE process);
|
||||
uint GetThreadId(HANDLE thread);
|
||||
void FlushProcessWriteBuffers(void);
|
||||
uint GetProcessIdOfThread(HANDLE thread);
|
||||
int InitializeProcThreadAttributeList(PVOID attribute_list,uint attribute_count,uint flags,ulong &size);
|
||||
void DeleteProcThreadAttributeList(PVOID attribute_list);
|
||||
int SetProcessAffinityUpdateMode(HANDLE process,uint flags);
|
||||
int QueryProcessAffinityUpdateMode(HANDLE process,uint &flags);
|
||||
int UpdateProcThreadAttribute(PVOID attribute_list,uint flags,uint attribute,PVOID value,ulong size,PVOID previous_value,ulong &return_size);
|
||||
HANDLE CreateRemoteThreadEx(HANDLE process,PVOID thread_attributes,ulong stack_size,PVOID start_address,PVOID parameter,uint creation_flags,PVOID attribute_list,uint &thread_id);
|
||||
void GetCurrentThreadStackLimits(ulong &low_limit,ulong &high_limit);
|
||||
int GetThreadContext(HANDLE thread,CONTEXT &context);
|
||||
int GetProcessMitigationPolicy(HANDLE process,PROCESS_MITIGATION_POLICY mitigation_policy,PVOID buffer,ulong length);
|
||||
int SetThreadContext(HANDLE thread,const CONTEXT &context);
|
||||
int SetProcessMitigationPolicy(PROCESS_MITIGATION_POLICY mitigation_policy,PVOID buffer,ulong length);
|
||||
int FlushInstructionCache(HANDLE process,const PVOID base_address,ulong size);
|
||||
int GetThreadTimes(HANDLE thread,FILETIME &creation_time,FILETIME &exit_time,FILETIME &kernel_time,FILETIME &user_time);
|
||||
HANDLE OpenProcess(uint desired_access,int inherit_handle,uint process_id);
|
||||
int IsProcessorFeaturePresent(uint processor_feature);
|
||||
int GetProcessHandleCount(HANDLE process,uint &handle_count);
|
||||
uint GetCurrentProcessorNumber(void);
|
||||
int SetThreadIdealProcessorEx(HANDLE thread,PROCESSOR_NUMBER &ideal_processor,PROCESSOR_NUMBER &previous_ideal_processor);
|
||||
int GetThreadIdealProcessorEx(HANDLE thread,PROCESSOR_NUMBER &ideal_processor);
|
||||
void GetCurrentProcessorNumberEx(PROCESSOR_NUMBER &proc_number);
|
||||
int GetProcessPriorityBoost(HANDLE process,int &disable_priority_boost);
|
||||
int SetProcessPriorityBoost(HANDLE process,int disable_priority_boost);
|
||||
int GetThreadIOPendingFlag(HANDLE thread,int &io_is_pending);
|
||||
int GetSystemTimes(FILETIME &idle_time,FILETIME &kernel_time,FILETIME &user_time);
|
||||
int GetThreadInformation(HANDLE thread,THREAD_INFORMATION_CLASS thread_information_class,PVOID thread_information,uint thread_information_size);
|
||||
int SetThreadInformation(HANDLE thread,THREAD_INFORMATION_CLASS thread_information_class,PVOID thread_information,uint thread_information_size);
|
||||
int IsProcessCritical(HANDLE process,int &critical);
|
||||
int SetProtectedPolicy(const GUID &policy_guid,ulong policy_value,ulong &old_policy_value);
|
||||
int QueryProtectedPolicy(const GUID &policy_guid,ulong &policy_value);
|
||||
uint SetThreadIdealProcessor(HANDLE thread,uint ideal_processor);
|
||||
int SetProcessInformation(HANDLE process,PROCESS_INFORMATION_CLASS process_information_class,PVOID process_information,uint process_information_size);
|
||||
int GetProcessInformation(HANDLE process,PROCESS_INFORMATION_CLASS process_information_class,PVOID process_information,uint process_information_size);
|
||||
int GetSystemCpuSetInformation(SYSTEM_CPU_SET_INFORMATION &information,uint buffer_length,ulong returned_length,HANDLE process,uint flags);
|
||||
int GetProcessDefaultCpuSets(HANDLE process,ulong &cpu_set_ids,uint cpu_set_id_count,ulong required_id_count);
|
||||
int SetProcessDefaultCpuSets(HANDLE process,const uint &cpu_set_ids,uint cpu_set_id_count);
|
||||
int GetThreadSelectedCpuSets(HANDLE thread,ulong &cpu_set_ids,uint cpu_set_id_count,ulong required_id_count);
|
||||
int SetThreadSelectedCpuSets(HANDLE thread,const uint &cpu_set_ids,uint cpu_set_id_count);
|
||||
int GetProcessShutdownParameters(uint &level,uint &flags);
|
||||
int SetThreadDescription(HANDLE thread,const string thread_description);
|
||||
int GetThreadDescription(HANDLE thread,string &thread_description);
|
||||
#import
|
||||
#import "advapi32.dll"
|
||||
int CreateProcessAsUserW(HANDLE token,const string application_name,string command_line,PVOID process_attributes,PVOID thread_attributes,int inherit_handles,uint creation_flags,PVOID environment,const string current_directory,STARTUPINFOW &startup_info,PROCESS_INFORMATION &process_information);
|
||||
int SetThreadToken(HANDLE thread,HANDLE token);
|
||||
int OpenProcessToken(HANDLE process_handle,uint desired_access,HANDLE &token_handle);
|
||||
int OpenThreadToken(HANDLE thread_handle,uint desired_access,int open_as_self,HANDLE &token_handle);
|
||||
#import
|
||||
//+------------------------------------------------------------------+
|
||||
@@ -0,0 +1,119 @@
|
||||
//+------------------------------------------------------------------+
|
||||
//| securitybaseapi.mqh |
|
||||
//| Copyright 2000-2024, MetaQuotes Ltd. |
|
||||
//| https://www.mql5.com |
|
||||
//+------------------------------------------------------------------+
|
||||
#include <WinAPI\windef.mqh>
|
||||
#include <WinAPI\winnt.mqh>
|
||||
//+------------------------------------------------------------------+
|
||||
//| |
|
||||
//+------------------------------------------------------------------+
|
||||
#import "advapi32.dll"
|
||||
int AccessCheck(SECURITY_DESCRIPTOR &security_descriptor,HANDLE client_token,uint desired_access,GENERIC_MAPPING &generic_mapping,PRIVILEGE_SET &privilege_set,uint &privilege_set_length,uint &granted_access,int &access_status);
|
||||
int AccessCheckAndAuditAlarmW(const string subsystem_name,PVOID handle_id,string object_type_name,string object_name,SECURITY_DESCRIPTOR &security_descriptor,uint desired_access,GENERIC_MAPPING &generic_mapping,int object_creation,uint &granted_access,int &access_status,int &generate_on_close);
|
||||
int AccessCheckByType(SECURITY_DESCRIPTOR &security_descriptor,SID &principal_self_sid,HANDLE client_token,uint desired_access,OBJECT_TYPE_LIST &object_type_list,uint object_type_list_length,GENERIC_MAPPING &generic_mapping,PRIVILEGE_SET &privilege_set,uint &privilege_set_length,uint &granted_access,int &access_status);
|
||||
int AccessCheckByTypeResultList(SECURITY_DESCRIPTOR &security_descriptor,SID &principal_self_sid,HANDLE client_token,uint desired_access,OBJECT_TYPE_LIST &object_type_list,uint object_type_list_length,GENERIC_MAPPING &generic_mapping,PRIVILEGE_SET &privilege_set,uint &privilege_set_length,uint &granted_access_list,uint &access_status_list);
|
||||
int AccessCheckByTypeAndAuditAlarmW(const string subsystem_name,PVOID handle_id,const string object_type_name,const string object_name,SECURITY_DESCRIPTOR &security_descriptor,SID &principal_self_sid,uint desired_access,AUDIT_EVENT_TYPE audit_type,uint flags,OBJECT_TYPE_LIST &object_type_list,uint object_type_list_length,GENERIC_MAPPING &generic_mapping,int object_creation,uint &granted_access,int &access_status,int &generate_on_close);
|
||||
int AccessCheckByTypeResultListAndAuditAlarmW(const string subsystem_name,PVOID handle_id,const string object_type_name,const string object_name,SECURITY_DESCRIPTOR &security_descriptor,SID &principal_self_sid,uint desired_access,AUDIT_EVENT_TYPE audit_type,uint flags,OBJECT_TYPE_LIST &object_type_list,uint object_type_list_length,GENERIC_MAPPING &generic_mapping,int object_creation,uint &granted_access_list,uint &access_status_list,int &generate_on_close);
|
||||
int AccessCheckByTypeResultListAndAuditAlarmByHandleW(const string subsystem_name,PVOID handle_id,HANDLE client_token,const string object_type_name,const string object_name,SECURITY_DESCRIPTOR &security_descriptor,SID &principal_self_sid,uint desired_access,AUDIT_EVENT_TYPE audit_type,uint flags,OBJECT_TYPE_LIST &object_type_list,uint object_type_list_length,GENERIC_MAPPING &generic_mapping,int object_creation,uint &granted_access_list,uint &access_status_list,int &generate_on_close);
|
||||
int AddAccessAllowedAce(ACL &acl,uint ace_revision,uint access_mask,SID &sid);
|
||||
int AddAccessAllowedAceEx(ACL &acl,uint ace_revision,uint ace_flags,uint access_mask,SID &sid);
|
||||
int AddAccessAllowedObjectAce(ACL &acl,uint ace_revision,uint ace_flags,uint access_mask,GUID &object_type_guid,GUID &inherited_object_type_guid,SID &sid);
|
||||
int AddAccessDeniedAce(ACL &acl,uint ace_revision,uint access_mask,SID &sid);
|
||||
int AddAccessDeniedAceEx(ACL &acl,uint ace_revision,uint ace_flags,uint access_mask,SID &sid);
|
||||
int AddAccessDeniedObjectAce(ACL &acl,uint ace_revision,uint ace_flags,uint access_mask,GUID &object_type_guid,GUID &inherited_object_type_guid,SID &sid);
|
||||
int AddAce(ACL &acl,uint ace_revision,uint starting_ace_index,PVOID ace_list,uint ace_list_length);
|
||||
int AddAuditAccessAce(ACL &acl,uint ace_revision,uint access_mask,SID &sid,int audit_success,int audit_failure);
|
||||
int AddAuditAccessAceEx(ACL &acl,uint ace_revision,uint ace_flags,uint access_mask,SID &sid,int audit_success,int audit_failure);
|
||||
int AddAuditAccessObjectAce(ACL &acl,uint ace_revision,uint ace_flags,uint access_mask,GUID &object_type_guid,GUID &inherited_object_type_guid,SID &sid,int audit_success,int audit_failure);
|
||||
int AddMandatoryAce(ACL &acl,uint ace_revision,uint ace_flags,uint mandatory_policy,SID &label_sid);
|
||||
int AdjustTokenGroups(HANDLE token_handle,int reset_to_default,TOKEN_GROUPS &new_state,uint buffer_length,TOKEN_GROUPS &previous_state,uint &return_length);
|
||||
int AdjustTokenPrivileges(HANDLE token_handle,int disable_all_privileges,TOKEN_PRIVILEGES &new_state,uint buffer_length,TOKEN_PRIVILEGES &previous_state,uint &return_length);
|
||||
int AllocateAndInitializeSid(SID_IDENTIFIER_AUTHORITY &identifier_authority,uchar sub_authority_count,uint sub_authority0,uint sub_authority1,uint sub_authority2,uint sub_authority3,uint sub_authority4,uint sub_authority5,uint sub_authority6,uint sub_authority7,SID &sid);
|
||||
int AllocateLocallyUniqueId(LUID &luid);
|
||||
int AreAllAccessesGranted(uint granted_access,uint desired_access);
|
||||
int AreAnyAccessesGranted(uint granted_access,uint desired_access);
|
||||
int CheckTokenMembership(HANDLE token_handle,SID &sid_to_check,int &is_member);
|
||||
int ConvertToAutoInheritPrivateObjectSecurity(SECURITY_DESCRIPTOR &parent_descriptor,SECURITY_DESCRIPTOR ¤t_security_descriptor,SECURITY_DESCRIPTOR &new_security_descriptor,GUID &object_type,uchar is_directory_object,GENERIC_MAPPING &generic_mapping);
|
||||
int CopySid(uint destination_sid_length,SID &destination_sid,SID &source_sid);
|
||||
int CreatePrivateObjectSecurity(SECURITY_DESCRIPTOR &parent_descriptor,SECURITY_DESCRIPTOR &creator_descriptor,SECURITY_DESCRIPTOR &new_descriptor,int is_directory_object,HANDLE token,GENERIC_MAPPING &generic_mapping);
|
||||
int CreatePrivateObjectSecurityEx(SECURITY_DESCRIPTOR &parent_descriptor,SECURITY_DESCRIPTOR &creator_descriptor,SECURITY_DESCRIPTOR &new_descriptor,GUID &object_type,int is_container_object,uint auto_inherit_flags,HANDLE token,GENERIC_MAPPING &generic_mapping);
|
||||
int CreatePrivateObjectSecurityWithMultipleInheritance(SECURITY_DESCRIPTOR &parent_descriptor,SECURITY_DESCRIPTOR &creator_descriptor,SECURITY_DESCRIPTOR &new_descriptor,GUID &object_types,uint guid_count,int is_container_object,uint auto_inherit_flags,HANDLE token,GENERIC_MAPPING &generic_mapping);
|
||||
int CreateRestrictedToken(HANDLE existing_token_handle,uint flags,uint disable_sid_count,SID_AND_ATTRIBUTES &sids_to_disable,uint delete_privilege_count,LUID_AND_ATTRIBUTES &privileges_to_delete,uint restricted_sid_count,SID_AND_ATTRIBUTES &sids_to_restrict,HANDLE &new_token_handle);
|
||||
int CreateWellKnownSid(WELL_KNOWN_SID_TYPE well_known_sid_type,SID &domain_sid,SID &sid,uint &sid);
|
||||
int EqualDomainSid(SID &sid1,SID &sid2,int &equal);
|
||||
int DeleteAce(ACL &acl,uint ace_index);
|
||||
int DestroyPrivateObjectSecurity(SECURITY_DESCRIPTOR &object_descriptor);
|
||||
int DuplicateToken(HANDLE existing_token_handle,SECURITY_IMPERSONATION_LEVEL impersonation_level,HANDLE &duplicate_token_handle);
|
||||
int DuplicateTokenEx(HANDLE existing_token,uint desired_access,PVOID token_attributes,SECURITY_IMPERSONATION_LEVEL impersonation_level,TOKEN_TYPE token_type,HANDLE &new_token);
|
||||
int EqualPrefixSid(SID &sid1,SID &sid2);
|
||||
int EqualSid(SID &sid1,SID &sid2);
|
||||
int FindFirstFreeAce(ACL &acl,PVOID &ace);
|
||||
PVOID FreeSid(SID &sid);
|
||||
int GetAce(ACL &acl,uint ace_index,PVOID &ace);
|
||||
int GetAclInformation(ACL &acl,PVOID acl_information,uint acl_information_length,ACL_INFORMATION_CLASS acl_information_class);
|
||||
int GetFileSecurityW(const string file_name,uint requested_information,SECURITY_DESCRIPTOR &security_descriptor,uint length,uint &length_needed);
|
||||
int GetKernelObjectSecurity(HANDLE handle,uint requested_information,SECURITY_DESCRIPTOR &security_descriptor,uint length,uint &length_needed);
|
||||
uint GetLengthSid(SID &sid);
|
||||
int GetPrivateObjectSecurity(SECURITY_DESCRIPTOR &object_descriptor,uint security_information,SECURITY_DESCRIPTOR &resultant_descriptor,uint descriptor_length,uint &return_length);
|
||||
int GetSecurityDescriptorControl(SECURITY_DESCRIPTOR &security_descriptor,ushort &control,uint &revision);
|
||||
int GetSecurityDescriptorDacl(SECURITY_DESCRIPTOR &security_descriptor,int &dacl_present,ACL &dacl,int &dacl_defaulted);
|
||||
int GetSecurityDescriptorGroup(SECURITY_DESCRIPTOR &security_descriptor,SID &group,int &group_defaulted);
|
||||
uint GetSecurityDescriptorLength(SECURITY_DESCRIPTOR &security_descriptor);
|
||||
int GetSecurityDescriptorOwner(SECURITY_DESCRIPTOR &security_descriptor,SID &owner,int &owner_defaulted);
|
||||
uint GetSecurityDescriptorRMControl(SECURITY_DESCRIPTOR &security_descriptor,uchar &rm_control);
|
||||
int GetSecurityDescriptorSacl(SECURITY_DESCRIPTOR &security_descriptor,int &sacl_present,ACL &sacl,int &sacl_defaulted);
|
||||
PVOID GetSidIdentifierAuthority(SID &sid);
|
||||
uint GetSidLengthRequired(uchar sub_authority_count);
|
||||
PVOID GetSidSubAuthority(SID &sid,uint sub_authority);
|
||||
PVOID GetSidSubAuthorityCount(SID &sid);
|
||||
int GetTokenInformation(HANDLE token_handle,TOKEN_INFORMATION_CLASS token_information_class,PVOID &token_information,uint token_information_length,uint &return_length);
|
||||
int GetWindowsAccountDomainSid(SID &sid,SID &domain_sid,uint &domain_sid);
|
||||
int ImpersonateAnonymousToken(HANDLE thread_handle);
|
||||
int ImpersonateLoggedOnUser(HANDLE token);
|
||||
int ImpersonateSelf(SECURITY_IMPERSONATION_LEVEL impersonation_level);
|
||||
int InitializeAcl(ACL &acl,uint acl_length,uint acl_revision);
|
||||
int InitializeSecurityDescriptor(SECURITY_DESCRIPTOR &security_descriptor,uint revision);
|
||||
int InitializeSid(SID &sid,SID_IDENTIFIER_AUTHORITY &identifier_authority,uchar sub_authority_count);
|
||||
int IsTokenRestricted(HANDLE token_handle);
|
||||
int IsValidAcl(ACL &acl);
|
||||
int IsValidSecurityDescriptor(SECURITY_DESCRIPTOR &security_descriptor);
|
||||
int IsValidSid(SID &sid);
|
||||
int IsWellKnownSid(SID &sid,WELL_KNOWN_SID_TYPE well_known_sid_type);
|
||||
int MakeAbsoluteSD(SECURITY_DESCRIPTOR &self_relative_security_descriptor,SECURITY_DESCRIPTOR &absolute_security_descriptor,uint &absolute_security_descriptor_size,ACL &dacl,uint &dacl_size,ACL &sacl,uint &sacl_size,SID &owner,uint &owner_size,SID &primary_group,uint &primary_group_size);
|
||||
int MakeSelfRelativeSD(SECURITY_DESCRIPTOR &absolute_security_descriptor,SECURITY_DESCRIPTOR &self_relative_security_descriptor,uint &buffer_length);
|
||||
void MapGenericMask(uint &access_mask,GENERIC_MAPPING &generic_mapping);
|
||||
int ObjectCloseAuditAlarmW(const string subsystem_name,PVOID handle_id,int generate_on_close);
|
||||
int ObjectDeleteAuditAlarmW(const string subsystem_name,PVOID handle_id,int generate_on_close);
|
||||
int ObjectOpenAuditAlarmW(const string subsystem_name,PVOID handle_id,string object_type_name,string object_name,SECURITY_DESCRIPTOR &security_descriptor,HANDLE client_token,uint desired_access,uint granted_access,PRIVILEGE_SET &privileges,int object_creation,int access_granted,int &generate_on_close);
|
||||
int ObjectPrivilegeAuditAlarmW(const string subsystem_name,PVOID handle_id,HANDLE client_token,uint desired_access,PRIVILEGE_SET &privileges,int access_granted);
|
||||
int PrivilegeCheck(HANDLE client_token,PRIVILEGE_SET &required_privileges,int &result);
|
||||
int PrivilegedServiceAuditAlarmW(const string subsystem_name,const string service_name,HANDLE client_token,PRIVILEGE_SET &privileges,int access_granted);
|
||||
void QuerySecurityAccessMask(uint security_information,uint &desired_access);
|
||||
int RevertToSelf(void);
|
||||
int SetAclInformation(ACL &acl,PVOID acl_information,uint acl_information_length,ACL_INFORMATION_CLASS acl_information_class);
|
||||
int SetFileSecurityW(const string file_name,uint security_information,SECURITY_DESCRIPTOR &security_descriptor);
|
||||
int SetKernelObjectSecurity(HANDLE handle,uint security_information,SECURITY_DESCRIPTOR &security_descriptor);
|
||||
int SetPrivateObjectSecurity(uint security_information,SECURITY_DESCRIPTOR &modification_descriptor,SECURITY_DESCRIPTOR &objects_security_descriptor,GENERIC_MAPPING &generic_mapping,HANDLE token);
|
||||
int SetPrivateObjectSecurityEx(uint security_information,SECURITY_DESCRIPTOR &modification_descriptor,SECURITY_DESCRIPTOR &objects_security_descriptor,uint auto_inherit_flags,GENERIC_MAPPING &generic_mapping,HANDLE token);
|
||||
void SetSecurityAccessMask(uint security_information,uint &desired_access);
|
||||
int SetSecurityDescriptorControl(SECURITY_DESCRIPTOR &security_descriptor,ushort control_bits_of_interest,ushort control_bits_to_set);
|
||||
int SetSecurityDescriptorDacl(SECURITY_DESCRIPTOR &security_descriptor,int dacl_present,ACL &dacl,int dacl_defaulted);
|
||||
int SetSecurityDescriptorGroup(SECURITY_DESCRIPTOR &security_descriptor,SID &group,int group_defaulted);
|
||||
int SetSecurityDescriptorOwner(SECURITY_DESCRIPTOR &security_descriptor,SID &owner,int owner_defaulted);
|
||||
uint SetSecurityDescriptorRMControl(SECURITY_DESCRIPTOR &security_descriptor,uchar &rm_control);
|
||||
int SetSecurityDescriptorSacl(SECURITY_DESCRIPTOR &security_descriptor,int sacl_present,ACL &sacl,int sacl_defaulted);
|
||||
int SetTokenInformation(HANDLE token_handle,TOKEN_INFORMATION_CLASS token_information_class,PVOID token_information,uint token_information_length);
|
||||
int CveEventWrite(const string cve_id,const string additional_details);
|
||||
#import
|
||||
|
||||
#import "kernel32.dll"
|
||||
int AddResourceAttributeAce(ACL &acl,uint ace_revision,uint ace_flags,uint access_mask,SID &sid,CLAIM_SECURITY_ATTRIBUTES_INFORMATION &attribute_info,uint &return_length);
|
||||
int AddScopedPolicyIDAce(ACL &acl,uint ace_revision,uint ace_flags,uint access_mask,SID &sid);
|
||||
int CheckTokenCapability(HANDLE token_handle,SID &capability_sid_to_check,int &has_capability);
|
||||
int GetAppContainerAce(ACL &acl,uint starting_ace_index,PVOID &app_container_ace,uint &app_container_ace_index);
|
||||
int CheckTokenMembershipEx(HANDLE token_handle,SID &sid_to_check,uint flags,int &is_member);
|
||||
int SetCachedSigningLevel(HANDLE &source_files,uint source_file_count,uint flags,HANDLE target_file);
|
||||
int GetCachedSigningLevel(HANDLE file,ulong flags,ulong signing_level,uchar &thumbprint[],ulong thumbprint_size,ulong thumbprint_algorithm);
|
||||
#import
|
||||
//+------------------------------------------------------------------+
|
||||
@@ -0,0 +1,95 @@
|
||||
//+------------------------------------------------------------------+
|
||||
//| sysinfoapi.mqh |
|
||||
//| Copyright 2000-2024, MetaQuotes Ltd. |
|
||||
//| https://www.mql5.com |
|
||||
//+------------------------------------------------------------------+
|
||||
#include <WinAPI\windef.mqh>
|
||||
#include <WinAPI\winbase.mqh>
|
||||
|
||||
//---
|
||||
enum COMPUTER_NAME_FORMAT
|
||||
{
|
||||
ComputerNameNetBIOS,
|
||||
ComputerNameDnsHostname,
|
||||
ComputerNameDnsDomain,
|
||||
ComputerNameDnsFullyQualified,
|
||||
ComputerNamePhysicalNetBIOS,
|
||||
ComputerNamePhysicalDnsHostname,
|
||||
ComputerNamePhysicalDnsDomain,
|
||||
ComputerNamePhysicalDnsFullyQualified,
|
||||
ComputerNameMax
|
||||
};
|
||||
//---
|
||||
struct DUMMYSTRUCTNAME
|
||||
{
|
||||
uint dwOemId;
|
||||
ushort wProcessorArchitecture;
|
||||
ushort wReserved;
|
||||
};
|
||||
//---
|
||||
struct MEMORYSTATUSEX
|
||||
{
|
||||
uint dwLength;
|
||||
uint dwMemoryLoad;
|
||||
ulong ullTotalPhys;
|
||||
ulong ullAvailPhys;
|
||||
ulong ullTotalPageFile;
|
||||
ulong ullAvailPageFile;
|
||||
ulong ullTotalVirtual;
|
||||
ulong ullAvailVirtual;
|
||||
ulong ullAvailExtendedVirtual;
|
||||
};
|
||||
//---
|
||||
struct SYSTEM_INFO
|
||||
{
|
||||
uint dwOemId;
|
||||
uint dwPageSize;
|
||||
PVOID lpMinimumApplicationAddress;
|
||||
PVOID lpMaximumApplicationAddress;
|
||||
ulong dwActiveProcessorMask;
|
||||
uint dwNumberOfProcessors;
|
||||
uint dwProcessorType;
|
||||
uint dwAllocationGranularity;
|
||||
ushort wProcessorLevel;
|
||||
ushort wProcessorRevision;
|
||||
};
|
||||
//+------------------------------------------------------------------+
|
||||
//| |
|
||||
//+------------------------------------------------------------------+
|
||||
#import "kernel32.dll"
|
||||
int GlobalMemoryStatusEx(MEMORYSTATUSEX &buffer);
|
||||
void GetSystemInfo(SYSTEM_INFO &system_info);
|
||||
void GetSystemTime(SYSTEMTIME &system_time);
|
||||
void GetSystemTimeAsFileTime(FILETIME &system_time_as_file_time);
|
||||
void GetLocalTime(SYSTEMTIME &system_time);
|
||||
uint GetVersion(void);
|
||||
int SetLocalTime(const SYSTEMTIME &system_time);
|
||||
uint GetTickCount(void);
|
||||
ulong GetTickCount64(void);
|
||||
int GetSystemTimeAdjustment(uint &time_adjustment,uint &time_increment,int &time_adjustment_disabled);
|
||||
uint GetSystemDirectoryW(ushort &buffer[],uint size);
|
||||
uint GetWindowsDirectoryW(ushort &buffer[],uint size);
|
||||
uint GetSystemWindowsDirectoryW(ushort &buffer[],uint size);
|
||||
int GetComputerNameExW(COMPUTER_NAME_FORMAT name_type,ushort &buffer[],uint &size);
|
||||
int SetComputerNameExW(COMPUTER_NAME_FORMAT name_type,const string buffer);
|
||||
int SetSystemTime(const SYSTEMTIME &system_time);
|
||||
int GetVersionExW(OSVERSIONINFOW &version_information);
|
||||
int GetLogicalProcessorInformation(SYSTEM_LOGICAL_PROCESSOR_INFORMATION &buffer[],uint &returned_length);
|
||||
int GetLogicalProcessorInformationEx(LOGICAL_PROCESSOR_RELATIONSHIP relationship_type,SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX &buffer[],uint &returned_length);
|
||||
void GetNativeSystemInfo(SYSTEM_INFO &system_info);
|
||||
void GetSystemTimePreciseAsFileTime(FILETIME &system_time_as_file_time);
|
||||
int GetProductInfo(uint os_major_version,uint os_minor_version,uint sp_major_version,uint sp_minor_version,uint &returned_product_type);
|
||||
uint EnumSystemFirmwareTables(uint firmware_table_provider_signature,PVOID &firmware_table_enum_buffer,uint buffer_size);
|
||||
uint EnumSystemFirmwareTables(uint firmware_table_provider_signature,uchar &firmware_table_enum_buffer[],uint buffer_size);
|
||||
uint GetSystemFirmwareTable(uint firmware_table_provider_signature,uint firmware_table_id,PVOID firmware_table_buffer,uint buffer_size);
|
||||
uint GetSystemFirmwareTable(uint firmware_table_provider_signature,uint firmware_table_id,uchar &firmware_table_buffer[],uint buffer_size);
|
||||
int DnsHostnameToComputerNameExW(const string hostname,ushort &computer_name[],uint &size);
|
||||
int GetPhysicallyInstalledSystemMemory(ulong &total_memory_in_kilobytes);
|
||||
int SetComputerNameEx2W(COMPUTER_NAME_FORMAT name_type,uint flags,const string buffer);
|
||||
int SetSystemTimeAdjustment(uint time_adjustment,int time_adjustment_disabled);
|
||||
int InstallELAMCertificateInfo(HANDLE elam_file);
|
||||
int GetProcessorSystemCycleTime(ushort group,PVOID &buffer,uint &returned_length);
|
||||
int GetProcessorSystemCycleTime(ushort group,SYSTEM_PROCESSOR_CYCLE_TIME_INFORMATION &buffer[],uint &returned_length);
|
||||
int SetComputerNameW(const string computer_name);
|
||||
#import
|
||||
//+------------------------------------------------------------------+
|
||||
@@ -0,0 +1,21 @@
|
||||
//+------------------------------------------------------------------+
|
||||
//| winapi.mqh |
|
||||
//| Copyright 2000-2024, MetaQuotes Ltd. |
|
||||
//| https://www.mql5.com |
|
||||
//+------------------------------------------------------------------+
|
||||
#include "windef.mqh"
|
||||
#include "winnt.mqh"
|
||||
#include "fileapi.mqh"
|
||||
#include "winbase.mqh"
|
||||
#include "winuser.mqh"
|
||||
#include "wingdi.mqh"
|
||||
#include "winreg.mqh"
|
||||
#include "handleapi.mqh"
|
||||
#include "processthreadsapi.mqh"
|
||||
#include "securitybaseapi.mqh"
|
||||
#include "errhandlingapi.mqh"
|
||||
#include "sysinfoapi.mqh"
|
||||
#include "processenv.mqh"
|
||||
#include "libloaderapi.mqh"
|
||||
#include "memoryapi.mqh"
|
||||
//+------------------------------------------------------------------+
|
||||
@@ -0,0 +1,814 @@
|
||||
//+------------------------------------------------------------------+
|
||||
//| WinBase.mqh |
|
||||
//| Copyright 2000-2024, MetaQuotes Ltd. |
|
||||
//| https://www.mql5.com |
|
||||
//+------------------------------------------------------------------+
|
||||
#include <WinAPI\windef.mqh>
|
||||
#include <WinAPI\winnt.mqh>
|
||||
#include <WinAPI\fileapi.mqh>
|
||||
|
||||
//---
|
||||
#define OFS_MAXPATHNAME 128
|
||||
#define HW_PROFILE_GUIDLEN 39
|
||||
#define MAX_PROFILE_LEN 80
|
||||
#define RESTART_MAX_CMD_LINE 1024
|
||||
|
||||
//---
|
||||
enum COPYFILE2_COPY_PHASE
|
||||
{
|
||||
COPYFILE2_PHASE_NONE=0,
|
||||
COPYFILE2_PHASE_PREPARE_SOURCE,
|
||||
COPYFILE2_PHASE_PREPARE_DEST,
|
||||
COPYFILE2_PHASE_READ_SOURCE,
|
||||
COPYFILE2_PHASE_WRITE_DESTINATION,
|
||||
COPYFILE2_PHASE_SERVER_COPY,
|
||||
COPYFILE2_PHASE_NAMEGRAFT_COPY,
|
||||
COPYFILE2_PHASE_MAX
|
||||
};
|
||||
//---
|
||||
enum COPYFILE2_MESSAGE_ACTION
|
||||
{
|
||||
COPYFILE2_PROGRESS_CONTINUE=0,
|
||||
COPYFILE2_PROGRESS_CANCEL,
|
||||
COPYFILE2_PROGRESS_STOP,
|
||||
COPYFILE2_PROGRESS_QUIET,
|
||||
COPYFILE2_PROGRESS_PAUSE
|
||||
};
|
||||
//---
|
||||
enum COPYFILE2_MESSAGE_TYPE
|
||||
{
|
||||
COPYFILE2_CALLBACK_NONE=0,
|
||||
COPYFILE2_CALLBACK_CHUNK_STARTED,
|
||||
COPYFILE2_CALLBACK_CHUNK_FINISHED,
|
||||
COPYFILE2_CALLBACK_STREAM_STARTED,
|
||||
COPYFILE2_CALLBACK_STREAM_FINISHED,
|
||||
COPYFILE2_CALLBACK_POLL_CONTINUE,
|
||||
COPYFILE2_CALLBACK_ERROR,
|
||||
COPYFILE2_CALLBACK_MAX
|
||||
};
|
||||
//---
|
||||
enum DEP_SYSTEM_POLICY_TYPE
|
||||
{
|
||||
DEPPolicyAlwaysOff=0,
|
||||
DEPPolicyAlwaysOn,
|
||||
DEPPolicyOptIn,
|
||||
DEPPolicyOptOut,
|
||||
DEPTotalPolicyCount
|
||||
};
|
||||
//---
|
||||
enum FILE_ID_TYPE
|
||||
{
|
||||
FileIdType,
|
||||
ObjectIdType,
|
||||
ExtendedFileIdType,
|
||||
MaximumFileIdType
|
||||
};
|
||||
//---
|
||||
enum PRIORITY_HINT
|
||||
{
|
||||
IoPriorityHintVeryLow=0,
|
||||
IoPriorityHintLow,
|
||||
IoPriorityHintNormal,
|
||||
MaximumIoPriorityHintType
|
||||
};
|
||||
//---
|
||||
enum PROC_THREAD_ATTRIBUTE_NUM
|
||||
{
|
||||
ProcThreadAttributeParentProcess=0,
|
||||
ProcThreadAttributeHandleList=2,
|
||||
ProcThreadAttributeGroupAffinity=3,
|
||||
ProcThreadAttributePreferredNode=4,
|
||||
ProcThreadAttributeIdealProcessor=5,
|
||||
ProcThreadAttributeUmsThread=6,
|
||||
ProcThreadAttributeMitigationPolicy=7,
|
||||
ProcThreadAttributeSecurityCapabilities=9,
|
||||
ProcThreadAttributeProtectionLevel=11,
|
||||
ProcThreadAttributeJobList=13,
|
||||
ProcThreadAttributeChildProcessPolicy=14,
|
||||
ProcThreadAttributeAllApplicationPackagesPolicy=15,
|
||||
ProcThreadAttributeWin32kFilter=16,
|
||||
ProcThreadAttributeSafeOpenPromptOriginClaim=17,
|
||||
ProcThreadAttributeDesktopAppPolicy=18
|
||||
};
|
||||
//---
|
||||
struct ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA
|
||||
{
|
||||
PVOID lpInformation;
|
||||
PVOID lpSectionBase;
|
||||
uint ulSectionLength;
|
||||
PVOID lpSectionGlobalDataBase;
|
||||
uint ulSectionGlobalDataLength;
|
||||
};
|
||||
//---
|
||||
struct ACTCTX_SECTION_KEYED_DATA
|
||||
{
|
||||
uint cbSize;
|
||||
uint ulDataFormatVersion;
|
||||
PVOID lpData;
|
||||
uint ulLength;
|
||||
PVOID lpSectionGlobalData;
|
||||
uint ulSectionGlobalDataLength;
|
||||
PVOID lpSectionBase;
|
||||
uint ulSectionTotalLength;
|
||||
HANDLE hActCtx;
|
||||
uint ulAssemblyRosterIndex;
|
||||
uint ulFlags;
|
||||
ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA AssemblyMetadata;
|
||||
};
|
||||
//---
|
||||
struct ACTCTX_SECTION_KEYED_DATA_2600
|
||||
{
|
||||
uint cbSize;
|
||||
uint ulDataFormatVersion;
|
||||
PVOID lpData;
|
||||
uint ulLength;
|
||||
PVOID lpSectionGlobalData;
|
||||
uint ulSectionGlobalDataLength;
|
||||
PVOID lpSectionBase;
|
||||
uint ulSectionTotalLength;
|
||||
HANDLE hActCtx;
|
||||
uint ulAssemblyRosterIndex;
|
||||
};
|
||||
//---
|
||||
struct ACTCTXW
|
||||
{
|
||||
uint cbSize;
|
||||
uint dwFlags;
|
||||
PVOID lpSource;
|
||||
ushort wProcessorArchitecture;
|
||||
ushort wLangId;
|
||||
PVOID lpAssemblyDirectory;
|
||||
PVOID lpResourceName;
|
||||
PVOID lpApplicationName;
|
||||
HANDLE hModule;
|
||||
};
|
||||
//---
|
||||
struct ACTIVATION_CONTEXT_BASIC_INFORMATION
|
||||
{
|
||||
HANDLE hActCtx;
|
||||
uint dwFlags;
|
||||
};
|
||||
//---
|
||||
struct DCB
|
||||
{
|
||||
uint DCBlength;
|
||||
uint BaudRate;
|
||||
uint Flags;
|
||||
ushort wReserved;
|
||||
ushort XonLim;
|
||||
ushort XoffLim;
|
||||
uchar ByteSize;
|
||||
uchar Parity;
|
||||
uchar StopBits;
|
||||
char XonChar;
|
||||
char XoffChar;
|
||||
char ErrorChar;
|
||||
char EofChar;
|
||||
char EvtChar;
|
||||
ushort wReserved1;
|
||||
};
|
||||
//---
|
||||
struct COMMCONFIG
|
||||
{
|
||||
uint dwSize;
|
||||
ushort wVersion;
|
||||
ushort wReserved;
|
||||
DCB dcb;
|
||||
uint dwProviderSubType;
|
||||
uint dwProviderOffset;
|
||||
uint dwProviderSize;
|
||||
short wcProviderData[2];
|
||||
};
|
||||
//---
|
||||
struct COMMPROP
|
||||
{
|
||||
ushort wPacketLength;
|
||||
ushort wPacketVersion;
|
||||
uint dwServiceMask;
|
||||
uint dwReserved1;
|
||||
uint dwMaxTxQueue;
|
||||
uint dwMaxRxQueue;
|
||||
uint dwMaxBaud;
|
||||
uint dwProvSubType;
|
||||
uint dwProvCapabilities;
|
||||
uint dwSettableParams;
|
||||
uint dwSettableBaud;
|
||||
ushort wSettableData;
|
||||
ushort wSettableStopParity;
|
||||
uint dwCurrentTxQueue;
|
||||
uint dwCurrentRxQueue;
|
||||
uint dwProvSpec1;
|
||||
uint dwProvSpec2;
|
||||
short wcProvChar[1];
|
||||
};
|
||||
//---
|
||||
struct COMMTIMEOUTS
|
||||
{
|
||||
uint ReadIntervalTimeout;
|
||||
uint ReadTotalTimeoutMultiplier;
|
||||
uint ReadTotalTimeoutConstant;
|
||||
uint WriteTotalTimeoutMultiplier;
|
||||
uint WriteTotalTimeoutConstant;
|
||||
};
|
||||
//---
|
||||
struct COMSTAT
|
||||
{
|
||||
uint cbInQue;
|
||||
uint cbOutQue;
|
||||
};
|
||||
//---
|
||||
struct COPYFILE2_EXTENDED_PARAMETERS
|
||||
{
|
||||
uint dwSize;
|
||||
uint dwCopyFlags;
|
||||
PVOID pfCancel;
|
||||
PVOID pProgressRoutine;
|
||||
PVOID pvCallbackContext;
|
||||
};
|
||||
//---
|
||||
struct EVENTLOG_FULL_INFORMATION
|
||||
{
|
||||
uint dwFull;
|
||||
};
|
||||
//---
|
||||
struct FILE_ALIGNMENT_INFO: public FILE_INFO
|
||||
{
|
||||
uint AlignmentRequirement;
|
||||
};
|
||||
//---
|
||||
struct FILE_ALLOCATION_INFO: public FILE_INFO
|
||||
{
|
||||
long AllocationSize;
|
||||
};
|
||||
//---
|
||||
struct FILE_ATTRIBUTE_TAG_INFO: public FILE_INFO
|
||||
{
|
||||
uint FileAttributes;
|
||||
uint ReparseTag;
|
||||
};
|
||||
//---
|
||||
struct FILE_BASIC_INFO: public FILE_INFO
|
||||
{
|
||||
long CreationTime;
|
||||
long LastAccessTime;
|
||||
long LastWriteTime;
|
||||
long ChangeTime;
|
||||
uint FileAttributes;
|
||||
};
|
||||
//---
|
||||
struct FILE_COMPRESSION_INFO: public FILE_INFO
|
||||
{
|
||||
long CompressedFileSize;
|
||||
ushort CompressionFormat;
|
||||
uchar CompressionUnitShift;
|
||||
uchar ChunkShift;
|
||||
uchar ClusterShift;
|
||||
uchar Reserved[3];
|
||||
};
|
||||
//---
|
||||
struct FILE_DISPOSITION_INFO: public FILE_INFO
|
||||
{
|
||||
uchar DeleteFile;
|
||||
};
|
||||
//---
|
||||
struct FILE_DISPOSITION_INFO_EX: public FILE_INFO
|
||||
{
|
||||
uint Flags;
|
||||
};
|
||||
//---
|
||||
struct FILE_END_OF_FILE_INFO: public FILE_INFO
|
||||
{
|
||||
long EndOfFile;
|
||||
};
|
||||
//---
|
||||
struct FILE_FULL_DIR_INFO: public FILE_INFO
|
||||
{
|
||||
uint NextEntryOffset;
|
||||
uint FileIndex;
|
||||
long CreationTime;
|
||||
long LastAccessTime;
|
||||
long LastWriteTime;
|
||||
long ChangeTime;
|
||||
long EndOfFile;
|
||||
long AllocationSize;
|
||||
uint FileAttributes;
|
||||
uint FileNameLength;
|
||||
uint EaSize;
|
||||
short FileName[1];
|
||||
};
|
||||
//---
|
||||
struct FILE_ID_BOTH_DIR_INFO: public FILE_INFO
|
||||
{
|
||||
uint NextEntryOffset;
|
||||
uint FileIndex;
|
||||
long CreationTime;
|
||||
long LastAccessTime;
|
||||
long LastWriteTime;
|
||||
long ChangeTime;
|
||||
long EndOfFile;
|
||||
long AllocationSize;
|
||||
uint FileAttributes;
|
||||
uint FileNameLength;
|
||||
uint EaSize;
|
||||
char ShortNameLength;
|
||||
short ShortName[12];
|
||||
long FileId;
|
||||
short FileName[1];
|
||||
};
|
||||
//---
|
||||
struct FILE_ID_EXTD_DIR_INFO: public FILE_INFO
|
||||
{
|
||||
uint NextEntryOffset;
|
||||
uint FileIndex;
|
||||
long CreationTime;
|
||||
long LastAccessTime;
|
||||
long LastWriteTime;
|
||||
long ChangeTime;
|
||||
long EndOfFile;
|
||||
long AllocationSize;
|
||||
uint FileAttributes;
|
||||
uint FileNameLength;
|
||||
uint EaSize;
|
||||
uint ReparsePointTag;
|
||||
FILE_ID_128 FileId;
|
||||
short FileName[1];
|
||||
};
|
||||
//---
|
||||
struct FILE_ID_INFO: public FILE_INFO
|
||||
{
|
||||
ulong VolumeSerialNumber;
|
||||
FILE_ID_128 FileId;
|
||||
};
|
||||
//---
|
||||
struct FILE_IO_PRIORITY_HINT_INFO: public FILE_INFO
|
||||
{
|
||||
PRIORITY_HINT PriorityHint;
|
||||
};
|
||||
//---
|
||||
struct FILE_NAME_INFO
|
||||
{
|
||||
uint FileNameLength;
|
||||
short FileName[2];
|
||||
};
|
||||
//---
|
||||
struct FILE_STANDARD_INFO: public FILE_INFO
|
||||
{
|
||||
long AllocationSize;
|
||||
long EndOfFile;
|
||||
uint NumberOfLinks;
|
||||
uchar DeletePending;
|
||||
uchar Directory;
|
||||
};
|
||||
//---
|
||||
struct FILE_STORAGE_INFO: public FILE_INFO
|
||||
{
|
||||
uint LogicalBytesPerSector;
|
||||
uint PhysicalBytesPerSectorForAtomicity;
|
||||
uint PhysicalBytesPerSectorForPerformance;
|
||||
uint FileSystemEffectivePhysicalBytesPerSectorForAtomicity;
|
||||
uint Flags;
|
||||
uint ByteOffsetForSectorAlignment;
|
||||
uint ByteOffsetForPartitionAlignment;
|
||||
};
|
||||
//---
|
||||
struct FILE_STREAM_INFO: public FILE_INFO
|
||||
{
|
||||
uint NextEntryOffset;
|
||||
uint StreamNameLength;
|
||||
long StreamSize;
|
||||
long StreamAllocationSize;
|
||||
short StreamName[1];
|
||||
};
|
||||
//---
|
||||
struct HW_PROFILE_INFOW
|
||||
{
|
||||
uint dwDockInfo;
|
||||
short szHwProfileGuid[HW_PROFILE_GUIDLEN];
|
||||
short szHwProfileName[MAX_PROFILE_LEN];
|
||||
};
|
||||
//---
|
||||
struct JIT_DEBUG_INFO
|
||||
{
|
||||
uint dwSize;
|
||||
uint dwProcessorArchitecture;
|
||||
uint dwThreadID;
|
||||
uint dwReserved0;
|
||||
ulong lpExceptionAddress;
|
||||
ulong lpExceptionRecord;
|
||||
ulong lpContextRecord;
|
||||
};
|
||||
//---
|
||||
struct MEMORYSTATUS
|
||||
{
|
||||
uint dwLength;
|
||||
uint dwMemoryLoad;
|
||||
ulong dwTotalPhys;
|
||||
ulong dwAvailPhys;
|
||||
ulong dwTotalPageFile;
|
||||
ulong dwAvailPageFile;
|
||||
ulong dwTotalVirtual;
|
||||
ulong dwAvailVirtual;
|
||||
};
|
||||
//---
|
||||
struct OFSTRUCT
|
||||
{
|
||||
uchar cBytes;
|
||||
uchar fFixedDisk;
|
||||
ushort nErrCode;
|
||||
ushort Reserved1;
|
||||
ushort Reserved2;
|
||||
char szPathName[OFS_MAXPATHNAME];
|
||||
};
|
||||
//---
|
||||
struct OPERATION_END_PARAMETERS
|
||||
{
|
||||
uint Version;
|
||||
uint OperationId;
|
||||
uint Flags;
|
||||
};
|
||||
//---
|
||||
struct OPERATION_START_PARAMETERS
|
||||
{
|
||||
uint Version;
|
||||
uint OperationId;
|
||||
uint Flags;
|
||||
};
|
||||
//---
|
||||
struct SYSTEM_POWER_STATUS
|
||||
{
|
||||
uchar ACLineStatus;
|
||||
uchar BatteryFlag;
|
||||
uchar BatteryLifePercent;
|
||||
uchar SystemStatusFlag;
|
||||
uint BatteryLifeTime;
|
||||
uint BatteryFullLifeTime;
|
||||
};
|
||||
//---
|
||||
struct UMS_SCHEDULER_STARTUP_INFO
|
||||
{
|
||||
uint UmsVersion;
|
||||
PVOID CompletionList;
|
||||
PVOID SchedulerProc;
|
||||
PVOID SchedulerParam;
|
||||
};
|
||||
//---
|
||||
struct WIN32_STREAM_ID
|
||||
{
|
||||
uint dwStreamId;
|
||||
uint dwStreamAttributes;
|
||||
long Size;
|
||||
uint dwStreamNameSize;
|
||||
};
|
||||
//---
|
||||
struct UMS_SYSTEM_THREAD_INFORMATION
|
||||
{
|
||||
uint UmsVersion;
|
||||
uint ThreadUmsFlags;
|
||||
};
|
||||
//---
|
||||
struct FILE_ID_DESCRIPTOR
|
||||
{
|
||||
uint dwSize;
|
||||
FILE_ID_TYPE Type;
|
||||
long FileId;
|
||||
};
|
||||
//---
|
||||
struct SYSTEMTIME
|
||||
{
|
||||
ushort wYear;
|
||||
ushort wMonth;
|
||||
ushort wDayOfWeek;
|
||||
ushort wDay;
|
||||
ushort wHour;
|
||||
ushort wMinute;
|
||||
ushort wSecond;
|
||||
ushort wMilliseconds;
|
||||
};
|
||||
//+------------------------------------------------------------------+
|
||||
//| |
|
||||
//+------------------------------------------------------------------+
|
||||
#import "kernel32.dll"
|
||||
int ActivateActCtx(HANDLE act_ctx,PVOID &cookie);
|
||||
int ActivateActCtx(ACTCTXW &act_ctx,PVOID &cookie);
|
||||
ushort AddAtomW(const string str);
|
||||
int AddIntegrityLabelToBoundaryDescriptor(HANDLE &BoundaryDescriptor,SID &IntegrityLabel);
|
||||
void AddRefActCtx(HANDLE act_ctx);
|
||||
void AddRefActCtx(ACTCTXW &act_ctx);
|
||||
int AddSecureMemoryCacheCallback(PVOID call_back);
|
||||
void ApplicationRecoveryFinished(int success);
|
||||
int ApplicationRecoveryInProgress(int &cancelled);
|
||||
int BackupRead(HANDLE file,uchar &buffer[],uint number_of_bytes_to_read,uint &number_of_bytes_read,int abort,int process_security,PVOID &context);
|
||||
int BackupSeek(HANDLE file,uint low_bytes_to_seek,uint high_bytes_to_seek,uint &low_byte_seeked,uint &high_byte_seeked,PVOID &context);
|
||||
int BackupWrite(HANDLE file,uchar &buffer[],uint number_of_bytes_to_write,uint &number_of_bytes_written,int abort,int process_security,PVOID &context);
|
||||
HANDLE BeginUpdateResourceW(const string file_name,int delete_existing_resources);
|
||||
int BindIoCompletionCallback(HANDLE FileHandle,PVOID Function,uint Flags);
|
||||
int BuildCommDCBAndTimeoutsW(const string def,DCB &lpDCB,COMMTIMEOUTS &comm_timeouts);
|
||||
int BuildCommDCBW(const string def,DCB &lpDCB);
|
||||
int CancelDeviceWakeupRequest(HANDLE device);
|
||||
int CancelTimerQueueTimer(HANDLE TimerQueue,HANDLE Timer);
|
||||
int CheckNameLegalDOS8Dot3W(const string name,char &oem_name[],uint oem_name_size,int &name_contains_spaces,int &name_legal);
|
||||
int ClearCommBreak(HANDLE file);
|
||||
int ClearCommError(HANDLE file,uint &errors,COMSTAT &stat);
|
||||
int CommConfigDialogW(const string name,HANDLE wnd,COMMCONFIG &lpCC);
|
||||
int ConvertFiberToThread(void);
|
||||
PVOID ConvertThreadToFiber(PVOID parameter);
|
||||
PVOID ConvertThreadToFiberEx(PVOID parameter,uint flags);
|
||||
int CopyContext(CONTEXT &Destination,uint ContextFlags,CONTEXT &Source);
|
||||
int CopyFile2(const string existing_file_name,const string new_file_name,COPYFILE2_EXTENDED_PARAMETERS &extended_parameters);
|
||||
int CopyFileExW(const string existing_file_name,const string new_file_name,PVOID progress_routine,PVOID data,int &cancel,uint copy_flags);
|
||||
int CopyFileTransactedW(const string existing_file_name,const string new_file_name,PVOID progress_routine,PVOID data,int &cancel,uint copy_flags,HANDLE transaction);
|
||||
int CopyFileW(const string existing_file_name,const string new_file_name,int fail_if_exists);
|
||||
HANDLE CreateActCtxW(const ACTCTXW &act_ctx);
|
||||
int CreateDirectoryExW(const string template_directory,const string new_directory,PVOID security_attributes);
|
||||
int CreateDirectoryTransactedW(const string template_directory,const string new_directory,PVOID security_attributes,HANDLE transaction);
|
||||
PVOID CreateFiber(ulong stack_size,PVOID start_address,PVOID parameter);
|
||||
PVOID CreateFiberEx(ulong stack_commit_size,ulong stack_reserve_size,uint flags,PVOID start_address,PVOID parameter);
|
||||
HANDLE CreateFileTransactedW(const string file_name,uint desired_access,uint share_mode,PVOID security_attributes,uint creation_disposition,uint flags_and_attributes,HANDLE template_file,HANDLE transaction,ushort &mini_version,PVOID extended_parameter);
|
||||
int CreateHardLinkTransactedW(const string file_name,const string existing_file_name,PVOID security_attributes,HANDLE transaction);
|
||||
int CreateHardLinkW(const string file_name,const string existing_file_name,PVOID security_attributes);
|
||||
int CreateJobSet(uint NumJob,JOB_SET_ARRAY &UserJobSet,uint Flags);
|
||||
HANDLE CreateMailslotW(const string name,uint max_message_size,uint read_timeout,PVOID security_attributes);
|
||||
uchar CreateSymbolicLinkTransactedW(const string symlink_file_name,const string target_file_name,uint flags,HANDLE transaction);
|
||||
uchar CreateSymbolicLinkW(const string symlink_file_name,const string target_file_name,uint flags);
|
||||
uint CreateTapePartition(HANDLE device,uint partition_method,uint count,uint size);
|
||||
int CreateUmsCompletionList(PVOID &UmsCompletionList);
|
||||
int CreateUmsThreadContext(PVOID &ums_thread);
|
||||
int DeactivateActCtx(uint flags,ulong cookie);
|
||||
int DebugBreakProcess(HANDLE Process);
|
||||
int DebugSetProcessKillOnExit(int KillOnExit);
|
||||
ushort DeleteAtom(ushort atom);
|
||||
void DeleteFiber(PVOID fiber);
|
||||
int DeleteFileTransactedW(const string file_name,HANDLE transaction);
|
||||
int DeleteTimerQueue(HANDLE TimerQueue);
|
||||
int DeleteUmsCompletionList(PVOID UmsCompletionList);
|
||||
int DeleteUmsThreadContext(PVOID UmsThread);
|
||||
int DequeueUmsCompletionListItems(PVOID UmsCompletionList,uint WaitTimeOut,PVOID &UmsThreadList);
|
||||
uint DisableThreadProfiling(HANDLE PerformanceDataHandle);
|
||||
int DnsHostnameToComputerNameW(const string hostname,ushort &computer_name[],uint &size);
|
||||
int DosDateTimeToFileTime(ushort fat_date,ushort fat_time,FILETIME &file_time);
|
||||
uint EnableThreadProfiling(HANDLE ThreadHandle,uint Flags,ulong HardwareCounters,HANDLE &PerformanceDataHandle);
|
||||
int EndUpdateResourceW(HANDLE update,int discard);
|
||||
int EnterUmsSchedulingMode(UMS_SCHEDULER_STARTUP_INFO &SchedulerStartupInfo);
|
||||
int EnumResourceLanguagesW(HANDLE module,const string type,const string name,PVOID enum_func,long param);
|
||||
int EnumResourceTypesW(HANDLE module,PVOID enum_func,long param);
|
||||
uint EraseTape(HANDLE device,uint erase_type,int immediate);
|
||||
int EscapeCommFunction(HANDLE file,uint func);
|
||||
int ExecuteUmsThread(PVOID UmsThread);
|
||||
void FatalExit(int ExitCode);
|
||||
int FileTimeToDosDateTime(FILETIME &file_time,ushort &fat_date,ushort &fat_time);
|
||||
int FindActCtxSectionGuid(uint flags,const GUID &extension_guid[],uint section_id,const GUID &guid_to_find[],ACTCTX_SECTION_KEYED_DATA &ReturnedData);
|
||||
int FindActCtxSectionStringW(uint flags,const GUID &extension_guid[],uint section_id,const string string_to_find,ACTCTX_SECTION_KEYED_DATA &ReturnedData);
|
||||
ushort FindAtomW(const string str);
|
||||
HANDLE FindFirstFileNameTransactedW(const string file_name,uint flags,uint &StringLength,string LinkName,HANDLE transaction);
|
||||
HANDLE FindFirstFileTransactedW(const string file_name,FINDEX_INFO_LEVELS info_level_id,FIND_DATAW &find_file_data,FINDEX_SEARCH_OPS search_op,PVOID search_filter,uint additional_flags,HANDLE transaction);
|
||||
HANDLE FindFirstStreamTransactedW(const string file_name,STREAM_INFO_LEVELS InfoLevel,FIND_STREAM_DATA &find_stream_data,uint flags,HANDLE transaction);
|
||||
HANDLE FindFirstVolumeMountPointW(const string root_path_name,ushort &volume_mount_point[],uint buffer_length);
|
||||
int FindNextVolumeMountPointW(HANDLE find_volume_mount_point,string volume_mount_point,uint buffer_length);
|
||||
int FindVolumeMountPointClose(HANDLE find_volume_mount_point);
|
||||
uint FormatMessageW(uint flags,const uchar &source[],uint message_id,uint language_id,ushort &buffer[],uint size,PVOID &Arguments[]);
|
||||
uint GetActiveProcessorCount(ushort GroupNumber);
|
||||
ushort GetActiveProcessorGroupCount(void);
|
||||
int GetApplicationRecoveryCallback(HANDLE process,PVOID &recovery_callback,PVOID ¶meter,uint &ping_interval,uint &flags);
|
||||
int GetApplicationRestartSettings(HANDLE process,ushort &commandline[],uint &size,uint &flags);
|
||||
uint GetAtomNameW(ushort atom,ushort &buffer[],int size);
|
||||
int GetBinaryTypeW(const string application_name,uint &binary_type);
|
||||
int GetCommConfig(HANDLE comm_dev,COMMCONFIG &lpCC,uint &size);
|
||||
int GetCommMask(HANDLE file,uint &evt_mask);
|
||||
int GetCommModemStatus(HANDLE file,uint &modem_stat);
|
||||
int GetCommProperties(HANDLE file,COMMPROP &comm_prop);
|
||||
int GetCommState(HANDLE file,DCB &lpDCB);
|
||||
int GetCommTimeouts(HANDLE file,COMMTIMEOUTS &comm_timeouts);
|
||||
uint GetCompressedFileSizeTransactedW(const string file_name,uint &file_size_high,HANDLE transaction);
|
||||
int GetComputerNameW(ushort &buffer[],uint &size);
|
||||
int GetCurrentActCtx(HANDLE &act_ctx);
|
||||
int GetCurrentActCtx(ACTCTXW &act_ctx);
|
||||
PVOID GetCurrentUmsThread(void);
|
||||
int GetDefaultCommConfigW(const string name,COMMCONFIG &lpCC,uint &size);
|
||||
int GetDevicePowerState(HANDLE device,int &on);
|
||||
uint GetDllDirectoryW(uint buffer_length,ushort &buffer[]);
|
||||
ulong GetEnabledXStateFeatures(void);
|
||||
int GetFileAttributesTransactedW(const string file_name,GET_FILEEX_INFO_LEVELS info_level_id,PVOID file_information,HANDLE transaction);
|
||||
int GetFileBandwidthReservation(HANDLE file,uint &period_milliseconds,uint &bytes_per_period,int &discardable,uint &transfer_size,uint &num_outstanding_requests);
|
||||
int GetFileInformationByHandleEx(HANDLE file,FILE_INFO_BY_HANDLE_CLASS FileInformationClass,PVOID file_information,uint buffer_size);
|
||||
int GetFileInformationByHandleEx(HANDLE file,FILE_INFO_BY_HANDLE_CLASS FileInformationClass,uchar &file_information[],uint buffer_size);
|
||||
uint GetFirmwareEnvironmentVariableExW(const string name,const string guid,PVOID buffer,uint size,uint &attribubutes);
|
||||
uint GetFirmwareEnvironmentVariableW(const string name,const string guid,PVOID buffer,uint size);
|
||||
int GetFirmwareType(FIRMWARE_TYPE &FirmwareType);
|
||||
uint GetFullPathNameTransactedW(const string file_name,uint buffer_length,string buffer,string &file_part,HANDLE transaction);
|
||||
uint GetLongPathNameTransactedW(const string short_path,string long_path,uint buffer,HANDLE transaction);
|
||||
int GetMailslotInfo(HANDLE mailslot,uint &max_message_size,uint &next_size,uint &message_count,uint &read_timeout);
|
||||
uint GetMaximumProcessorCount(ushort GroupNumber);
|
||||
ushort GetMaximumProcessorGroupCount(void);
|
||||
int GetNamedPipeClientProcessId(HANDLE Pipe,uint &ClientProcessId);
|
||||
int GetNamedPipeClientSessionId(HANDLE Pipe,uint &ClientSessionId);
|
||||
int GetNamedPipeServerProcessId(HANDLE Pipe,uint &ServerProcessId);
|
||||
int GetNamedPipeServerSessionId(HANDLE Pipe,uint &ServerSessionId);
|
||||
PVOID GetNextUmsListItem(PVOID UmsContext);
|
||||
int GetNumaAvailableMemoryNode(uchar Node,ulong &AvailableBytes);
|
||||
int GetNumaAvailableMemoryNodeEx(ushort Node,ulong &AvailableBytes);
|
||||
int GetNumaNodeNumberFromHandle(HANDLE file,ushort &NodeNumber);
|
||||
int GetNumaNodeProcessorMask(uchar Node,ulong &ProcessorMask);
|
||||
int GetNumaProcessorNode(uchar Processor,uchar &NodeNumber);
|
||||
int GetNumaProcessorNodeEx(PROCESSOR_NUMBER &Processor,ushort &NodeNumber);
|
||||
int GetNumaProximityNode(uint ProximityId,uchar &NodeNumber);
|
||||
uint GetPrivateProfileIntW(const string app_name,const string key_name,int default_value,const string file_name);
|
||||
uint GetPrivateProfileSectionNamesW(string return_buffer,uint size,const string file_name);
|
||||
uint GetPrivateProfileSectionW(const string app_name,string returned_string,uint size,const string file_name);
|
||||
uint GetPrivateProfileStringW(const string app_name,const string key_name,const string default_value,string returned_string,uint size,const string file_name);
|
||||
int GetPrivateProfileStructW(const string section,const string key,PVOID struct_obj,uint size_struct,const string file);
|
||||
int GetProcessAffinityMask(HANDLE process,ulong &process_affinity_mask,ulong &system_affinity_mask);
|
||||
int GetProcessDEPPolicy(HANDLE process,uint &flags,int &permanent);
|
||||
int GetProcessIoCounters(HANDLE process,IO_COUNTERS &io_counters);
|
||||
int GetProcessWorkingSetSize(HANDLE process,ulong &minimum_working_set_size,ulong &maximum_working_set_size);
|
||||
uint GetProfileIntW(const string app_name,const string key_name,int default_value);
|
||||
uint GetProfileSectionW(const string app_name,string returned_string,uint size);
|
||||
uint GetProfileStringW(const string app_name,const string key_name,const string default_value,string returned_string,uint size);
|
||||
DEP_SYSTEM_POLICY_TYPE GetSystemDEPPolicy(void);
|
||||
int GetSystemPowerStatus(SYSTEM_POWER_STATUS &system_power_status);
|
||||
int GetSystemRegistryQuota(uint "a_allowed,uint "a_used);
|
||||
uint GetTapeParameters(HANDLE device,uint operation,uint &size,PVOID tape_information);
|
||||
uint GetTapePosition(HANDLE device,uint position_type,uint &partition,uint &offset_low,uint &offset_high);
|
||||
uint GetTapeStatus(HANDLE device);
|
||||
int GetThreadSelectorEntry(HANDLE thread,uint selector,LDT_ENTRY &selector_entry);
|
||||
int GetUmsCompletionListEvent(PVOID UmsCompletionList,HANDLE &UmsCompletionEvent);
|
||||
int GetUmsSystemThreadInformation(HANDLE ThreadHandle,UMS_SYSTEM_THREAD_INFORMATION &SystemThreadInfo);
|
||||
int GetXStateFeaturesMask(CONTEXT &Context,ulong &FeatureMask);
|
||||
ushort GlobalAddAtomExW(const string str,uint Flags);
|
||||
ushort GlobalAddAtomW(const string str);
|
||||
HANDLE GlobalAlloc(uint flags,ulong bytes);
|
||||
ulong GlobalCompact(uint min_free);
|
||||
ushort GlobalDeleteAtom(ushort atom);
|
||||
ushort GlobalFindAtomW(const string str);
|
||||
void GlobalFix(HANDLE mem);
|
||||
uint GlobalFlags(HANDLE mem);
|
||||
HANDLE GlobalFree(HANDLE mem);
|
||||
uint GlobalGetAtomNameW(ushort atom,ushort &buffer[],int size);
|
||||
HANDLE GlobalHandle(const PVOID mem);
|
||||
PVOID GlobalLock(HANDLE mem);
|
||||
void GlobalMemoryStatus(MEMORYSTATUS &buffer);
|
||||
HANDLE GlobalReAlloc(HANDLE mem,ulong bytes,uint flags);
|
||||
ulong GlobalSize(HANDLE mem);
|
||||
void GlobalUnfix(HANDLE mem);
|
||||
int GlobalUnlock(HANDLE mem);
|
||||
int GlobalUnWire(HANDLE mem);
|
||||
PVOID GlobalWire(HANDLE mem);
|
||||
int InitAtomTable(uint size);
|
||||
int InitializeContext(uchar &Buffer[],uint ContextFlags,CONTEXT &Context,uint &ContextLength);
|
||||
int InitializeContext(PVOID Buffer,uint ContextFlags,CONTEXT &Context,uint &ContextLength);
|
||||
int IsBadCodePtr(PVOID lpfn);
|
||||
int IsBadHugeReadPtr(PVOID lp,ulong ucb);
|
||||
int IsBadHugeWritePtr(PVOID lp,ulong ucb);
|
||||
int IsBadReadPtr(PVOID lp,ulong ucb);
|
||||
int IsBadStringPtrW(const string lpsz,ulong max);
|
||||
int IsBadWritePtr(PVOID lp,ulong ucb);
|
||||
int IsNativeVhdBoot(int &NativeVhdBoot);
|
||||
int IsSystemResumeAutomatic(void);
|
||||
HANDLE LoadPackagedLibrary(const string lib_file_name,uint Reserved);
|
||||
HANDLE LocalAlloc(uint flags,ulong bytes);
|
||||
ulong LocalCompact(uint min_free);
|
||||
uint LocalFlags(HANDLE mem);
|
||||
HANDLE LocalFree(HANDLE mem);
|
||||
HANDLE LocalHandle(const PVOID mem);
|
||||
PVOID LocalLock(HANDLE mem);
|
||||
HANDLE LocalReAlloc(HANDLE mem,ulong bytes,uint flags);
|
||||
ulong LocalShrink(HANDLE mem,uint new_size);
|
||||
ulong LocalSize(HANDLE mem);
|
||||
int LocalUnlock(HANDLE mem);
|
||||
PVOID LocateXStateFeature(CONTEXT &Context,uint FeatureId,uint &Length);
|
||||
string lstrcatW(ushort &string1[],const string string2);
|
||||
int lstrcmpiW(const string string1,const string string2);
|
||||
int lstrcmpW(const string string1,const string string2);
|
||||
string lstrcpynW(ushort &string1[],const string string2,int max_length);
|
||||
string lstrcpyW(ushort &string1[],const string string2);
|
||||
int lstrlenW(const string str);
|
||||
int MapUserPhysicalPagesScatter(PVOID &VirtualAddresses[],ulong NumberOfPages,ulong &PageArray[]);
|
||||
PVOID MapViewOfFileExNuma(HANDLE file_mapping_object,uint desired_access,uint file_offset_high,uint file_offset_low,ulong number_of_bytes_to_map,PVOID base_address,uint preferred);
|
||||
int MoveFileExW(const string existing_file_name,const string new_file_name,uint flags);
|
||||
int MoveFileTransactedW(const string existing_file_name,const string new_file_name,PVOID progress_routine,PVOID data,uint flags,HANDLE transaction);
|
||||
int MoveFileW(const string existing_file_name,const string new_file_name);
|
||||
int MoveFileWithProgressW(const string existing_file_name,const string new_file_name,PVOID progress_routine,PVOID data,uint flags);
|
||||
int MulDiv(int number,int numerator,int denominator);
|
||||
HANDLE OpenFileById(HANDLE volume_hint,FILE_ID_DESCRIPTOR &file_id,uint desired_access,uint share_mode,PVOID security_attributes,uint flags_and_attributes);
|
||||
int PowerClearRequest(HANDLE PowerRequest,POWER_REQUEST_TYPE RequestType);
|
||||
HANDLE PowerCreateRequest(REASON_CONTEXT &Context);
|
||||
int PowerSetRequest(HANDLE PowerRequest,POWER_REQUEST_TYPE RequestType);
|
||||
uint PrepareTape(HANDLE device,uint operation,int immediate);
|
||||
int PulseEvent(HANDLE event);
|
||||
int PurgeComm(HANDLE file,uint flags);
|
||||
int QueryActCtxSettingsW(uint flags,HANDLE act_ctx,const string name_space,const string name,string buffer,ulong buffer,ulong &written_or_required);
|
||||
int QueryActCtxSettingsW(uint flags,ACTCTXW &act_ctx,const string name_space,const string name,string buffer,ulong buffer,ulong &written_or_required);
|
||||
int QueryActCtxW(uint flags,HANDLE act_ctx,PVOID sub_instance,uint info_class,PVOID buffer,ulong buffer,ulong &written_or_required);
|
||||
int QueryActCtxW(uint flags,ACTCTXW &act_ctx,PVOID sub_instance,uint info_class,PVOID buffer,ulong buffer,ulong &written_or_required);
|
||||
int QueryFullProcessImageNameW(HANDLE process,uint flags,string exe_name,uint &size);
|
||||
uint QueryThreadProfiling(HANDLE ThreadHandle,uchar &Enabled);
|
||||
int QueryUmsThreadInformation(PVOID UmsThread,RTL_UMS_THREAD_INFO_CLASS UmsThreadInfoClass,PVOID UmsThreadInformation,uint UmsThreadInformationLength,uint &ReturnLength);
|
||||
int ReadDirectoryChangesExW(HANDLE directory,PVOID buffer,uint buffer_length,int watch_subtree,uint notify_filter,uint &bytes_returned,OVERLAPPED &overlapped,PVOID completion_routine,READ_DIRECTORY_NOTIFY_INFORMATION_CLASS ReadDirectoryNotifyInformationClass);
|
||||
int ReadDirectoryChangesW(HANDLE directory,PVOID buffer,uint buffer_length,int watch_subtree,uint notify_filter,uint &bytes_returned,OVERLAPPED &overlapped,PVOID completion_routine);
|
||||
uint ReadThreadProfilingData(HANDLE PerformanceDataHandle,uint Flags,PERFORMANCE_DATA &PerformanceData);
|
||||
int RegisterApplicationRecoveryCallback(PVOID recovey_callback,PVOID parameter,uint ping_interval,uint flags);
|
||||
int RegisterApplicationRestart(const string commandline,uint flags);
|
||||
int RegisterWaitForSingleObject(HANDLE &new_wait_object,HANDLE object,PVOID Callback,PVOID Context,uint milliseconds,uint flags);
|
||||
void ReleaseActCtx(HANDLE act_ctx);
|
||||
void ReleaseActCtx(ACTCTXW &act_ctx);
|
||||
int RemoveDirectoryTransactedW(const string path_name,HANDLE transaction);
|
||||
int RemoveSecureMemoryCacheCallback(PVOID call_back);
|
||||
HANDLE ReOpenFile(HANDLE original_file,uint desired_access,uint share_mode,uint flags_and_attributes);
|
||||
int ReplaceFileW(const string replaced_file_name,const string replacement_file_name,const string backup_file_name,uint replace_flags,PVOID exclude,PVOID reserved);
|
||||
int ReplacePartitionUnit(string TargetPartition,string SparePartition,uint Flags);
|
||||
int RequestDeviceWakeup(HANDLE device);
|
||||
int RequestWakeupLatency(LATENCY_TIME latency);
|
||||
void RestoreLastError(uint err_code);
|
||||
int SetCommBreak(HANDLE file);
|
||||
int SetCommConfig(HANDLE comm_dev,COMMCONFIG &lpCC,uint size);
|
||||
int SetCommMask(HANDLE file,uint evt_mask);
|
||||
int SetCommState(HANDLE file,DCB &lpDCB);
|
||||
int SetCommTimeouts(HANDLE file,COMMTIMEOUTS &comm_timeouts);
|
||||
int SetDefaultCommConfigW(const string name,COMMCONFIG &lpCC,uint size);
|
||||
int SetDllDirectoryW(const string path_name);
|
||||
int SetFileAttributesTransactedW(const string file_name,uint file_attributes,HANDLE transaction);
|
||||
int SetFileBandwidthReservation(HANDLE file,uint period_milliseconds,uint bytes_per_period,int discardable,uint &transfer_size,uint &num_outstanding_requests);
|
||||
int SetFileCompletionNotificationModes(HANDLE FileHandle,uchar Flags);
|
||||
int SetFileShortNameW(HANDLE file,const string short_name);
|
||||
int SetFirmwareEnvironmentVariableExW(const string name,const string guid,PVOID value,uint size,uint attributes);
|
||||
int SetFirmwareEnvironmentVariableW(const string name,const string guid,PVOID value,uint size);
|
||||
uint SetHandleCount(uint number);
|
||||
int SetMailslotInfo(HANDLE mailslot,uint read_timeout);
|
||||
int SetMessageWaitingIndicator(HANDLE msg_indicator,uint msg_count);
|
||||
int SetProcessAffinityMask(HANDLE process,PVOID process_affinity_mask);
|
||||
int SetProcessDEPPolicy(uint flags);
|
||||
int SetProcessWorkingSetSize(HANDLE process,ulong minimum_working_set_size,ulong maximum_working_set_size);
|
||||
int SetSearchPathMode(uint flags);
|
||||
int SetSystemPowerState(int suspend,int force);
|
||||
uint SetTapeParameters(HANDLE device,uint operation,PVOID tape_information);
|
||||
uint SetTapePosition(HANDLE device,uint position_method,uint partition,uint offset_low,uint offset_high,int immediate);
|
||||
PVOID SetThreadAffinityMask(HANDLE thread,PVOID thread_affinity_mask);
|
||||
uint SetThreadExecutionState(uint flags);
|
||||
HANDLE SetTimerQueueTimer(HANDLE TimerQueue,PVOID Callback,PVOID Parameter,uint DueTime,uint Period,int PreferIo);
|
||||
int SetUmsThreadInformation(PVOID UmsThread,RTL_UMS_THREAD_INFO_CLASS UmsThreadInfoClass,PVOID UmsThreadInformation,uint UmsThreadInformationLength);
|
||||
int SetupComm(HANDLE file,uint in_queue,uint out_queue);
|
||||
int SetVolumeLabelW(const string root_path_name,const string volume_name);
|
||||
int SetVolumeMountPointW(const string volume_mount_point,const string volume_name);
|
||||
int SetXStateFeaturesMask(CONTEXT &Context,ulong FeatureMask);
|
||||
uint SignalObjectAndWait(HANDLE object_to_signal,HANDLE object_to_wait_on,uint milliseconds,int alertable);
|
||||
void SwitchToFiber(PVOID fiber);
|
||||
int TransmitCommChar(HANDLE file,char symbol);
|
||||
int UmsThreadYield(PVOID SchedulerParam);
|
||||
int UnregisterApplicationRecoveryCallback(void);
|
||||
int UnregisterApplicationRestart(void);
|
||||
int UnregisterWait(HANDLE WaitHandle);
|
||||
int UpdateResourceW(HANDLE update,const string type,const string name,ushort &language,PVOID data,uint cb);
|
||||
int VerifyVersionInfoW(OSVERSIONINFOEXW &version_information,uint type_mask,ulong condition_mask);
|
||||
int WaitCommEvent(HANDLE file,uint &evt_mask,OVERLAPPED &overlapped);
|
||||
uchar Wow64EnableWow64FsRedirection(uchar Wow64FsEnableRedirection);
|
||||
int Wow64GetThreadContext(HANDLE thread,CONTEXT &context);
|
||||
int Wow64GetThreadSelectorEntry(HANDLE thread,uint selector,LDT_ENTRY &selector_entry);
|
||||
int Wow64SetThreadContext(HANDLE thread,CONTEXT &context);
|
||||
uint Wow64SuspendThread(HANDLE thread);
|
||||
int WritePrivateProfileSectionW(const string app_name,const string str,const string file_name);
|
||||
int WritePrivateProfileStringW(const string app_name,const string key_name,const string str,const string file_name);
|
||||
int WritePrivateProfileStructW(const string section,const string key,PVOID struct_obj,uint size_struct,const string file);
|
||||
int WriteProfileSectionW(const string app_name,const string str);
|
||||
int WriteProfileStringW(const string app_name,const string key_name,const string str);
|
||||
uint WriteTapemark(HANDLE device,uint tapemark_type,uint tapemark_count,int immediate);
|
||||
uint WTSGetActiveConsoleSessionId(void);
|
||||
int ZombifyActCtx(HANDLE act_ctx);
|
||||
int ZombifyActCtx(ACTCTXW &act_ctx);
|
||||
#import
|
||||
|
||||
#import "advapi32.dll"
|
||||
int AddConditionalAce(ACL &acl,uint ace_revision,uint AceFlags,uchar AceType,uint AccessMask,SID &sid,string ConditionStr,uint &ReturnLength);
|
||||
int BackupEventLogW(HANDLE event_log,const string backup_file_name);
|
||||
int ClearEventLogW(HANDLE event_log,const string backup_file_name);
|
||||
void CloseEncryptedFileRaw(PVOID context);
|
||||
int CloseEventLog(HANDLE event_log);
|
||||
int DecryptFileW(const string file_name,uint reserved);
|
||||
int DeregisterEventSource(HANDLE event_log);
|
||||
int EncryptFileW(const string file_name);
|
||||
int FileEncryptionStatusW(const string file_name,uint &status);
|
||||
int GetCurrentHwProfileW(HW_PROFILE_INFOW &hw_profile_info);
|
||||
int GetEventLogInformation(HANDLE event_log,uint info_level,PVOID buffer,uint buf_size,uint &bytes_needed);
|
||||
int GetNumberOfEventLogRecords(HANDLE event_log,uint &NumberOfRecords);
|
||||
int GetOldestEventLogRecord(HANDLE event_log,uint &OldestRecord);
|
||||
int GetUserNameW(string buffer,uint &buffer);
|
||||
int IsTextUnicode(PVOID lpv,int size,int &result);
|
||||
int IsTokenUntrusted(HANDLE TokenHandle);
|
||||
int LogonUserExW(const string username,const string domain,const string password,uint logon_type,uint logon_provider,HANDLE &token,PVOID &logon_sid,PVOID &profile_buffer,uint &profile_length,QUOTA_LIMITS "a_limits);
|
||||
int LogonUserW(const string username,const string domain,const string password,uint logon_type,uint logon_provider,HANDLE &token);
|
||||
int LookupAccountNameW(const string system_name,const string account_name,SID &Sid,uint &sid,string ReferencedDomainName,uint &referenced_domain_name,SID_NAME_USE &use);
|
||||
int LookupAccountSidW(const string system_name,SID &Sid,string Name,uint &name,string ReferencedDomainName,uint &referenced_domain_name,SID_NAME_USE &use);
|
||||
int LookupPrivilegeDisplayNameW(const string system_name,const string name,string display_name,uint &display_name,uint &language_id);
|
||||
int LookupPrivilegeNameW(const string system_name,LUID &luid,string name,uint &name);
|
||||
int LookupPrivilegeValueW(const string system_name,const string name,LUID &luid);
|
||||
int NotifyChangeEventLog(HANDLE event_log,HANDLE event);
|
||||
HANDLE OpenBackupEventLogW(const string lpUNCServerName,const string file_name);
|
||||
uint OpenEncryptedFileRawW(const string file_name,uint flags,PVOID &context);
|
||||
HANDLE OpenEventLogW(const string lpUNCServerName,const string source_name);
|
||||
int OperationEnd(OPERATION_END_PARAMETERS &OperationEndParams);
|
||||
int OperationStart(OPERATION_START_PARAMETERS &OperationStartParams);
|
||||
uint ReadEncryptedFileRaw(PVOID export_callback,PVOID callback_context,PVOID context);
|
||||
int ReadEventLogW(HANDLE event_log,uint read_flags,uint record_offset,PVOID buffer,uint number_of_bytes_to_read,uint &bytes_read,uint &min_number_of_bytes_needed);
|
||||
HANDLE RegisterEventSourceW(const string lpUNCServerName,const string source_name);
|
||||
int ReportEventW(HANDLE event_log,ushort &type,ushort &category,uint dwEventID,SID &user_sid,ushort &num_strings,uint data_size,const string &strings[],PVOID raw_data);
|
||||
uint WriteEncryptedFileRaw(PVOID import_callback,PVOID callback_context,PVOID context);
|
||||
#import
|
||||
//+------------------------------------------------------------------+
|
||||
@@ -0,0 +1,325 @@
|
||||
//+------------------------------------------------------------------+
|
||||
//| windef.mqh |
|
||||
//| Copyright 2000-2024, MetaQuotes Ltd. |
|
||||
//| https://www.mql5.com |
|
||||
//+------------------------------------------------------------------+
|
||||
#define HANDLE long
|
||||
#define PVOID long
|
||||
//---
|
||||
#define ANYSIZE_ARRAY 1
|
||||
#define MAX_BREAKPOINTS 8
|
||||
#define MAX_WATCHPOINTS 2
|
||||
#define MAX_HW_COUNTERS 16
|
||||
#define MAX_PATH 260
|
||||
#define EXCEPTION_MAXIMUM_PARAMETERS 15
|
||||
|
||||
//---
|
||||
enum LATENCY_TIME
|
||||
{
|
||||
LT_DONT_CARE,
|
||||
LT_LOWEST_LATENCY
|
||||
};
|
||||
//---
|
||||
enum GET_FILEEX_INFO_LEVELS
|
||||
{
|
||||
GetFileExInfoStandard,
|
||||
GetFileExMaxInfoLevel
|
||||
};
|
||||
//---
|
||||
enum FINDEX_INFO_LEVELS
|
||||
{
|
||||
FindExInfoStandard,
|
||||
FindExInfoBasic,
|
||||
FindExInfoMaxInfoLevel
|
||||
};
|
||||
//---
|
||||
enum FINDEX_SEARCH_OPS
|
||||
{
|
||||
FindExSearchNameMatch,
|
||||
FindExSearchLimitToDirectories,
|
||||
FindExSearchLimitToDevices,
|
||||
FindExSearchMaxSearchOp
|
||||
};
|
||||
//---
|
||||
enum DPI_AWARENESS
|
||||
{
|
||||
DPI_AWARENESS_INVALID=-1,
|
||||
DPI_AWARENESS_UNAWARE=0,
|
||||
DPI_AWARENESS_SYSTEM_AWARE=1,
|
||||
DPI_AWARENESS_PER_MONITOR_AWARE=2
|
||||
};
|
||||
//---
|
||||
enum DPI_HOSTING_BEHAVIOR
|
||||
{
|
||||
DPI_HOSTING_BEHAVIOR_INVALID=-1,
|
||||
DPI_HOSTING_BEHAVIOR_DEFAULT=0,
|
||||
DPI_HOSTING_BEHAVIOR_MIXED=1
|
||||
};
|
||||
//---
|
||||
enum FILE_INFO_BY_HANDLE_CLASS
|
||||
{
|
||||
FileBasicInfo=0,
|
||||
FileStandardInfo=1,
|
||||
FileNameInfo=2,
|
||||
FileRenameInfo=3,
|
||||
FileDispositionInfo= 4,
|
||||
FileAllocationInfo = 5,
|
||||
FileEndOfFileInfo=6,
|
||||
FileStreamInfo=7,
|
||||
FileCompressionInfo=8,
|
||||
FileAttributeTagInfo=9,
|
||||
FileIdBothDirectoryInfo=10,
|
||||
FileIdBothDirectoryRestartInfo=11,
|
||||
FileIoPriorityHintInfo = 12,
|
||||
FileRemoteProtocolInfo = 13,
|
||||
FileFullDirectoryInfo=14,
|
||||
FileFullDirectoryRestartInfo=15,
|
||||
FileStorageInfo=16,
|
||||
FileAlignmentInfo=17,
|
||||
FileIdInfo=18,
|
||||
FileIdExtdDirectoryInfo=19,
|
||||
FileIdExtdDirectoryRestartInfo=20,
|
||||
MaximumFileInfoByHandlesClass
|
||||
};
|
||||
//---
|
||||
enum READ_DIRECTORY_NOTIFY_INFORMATION_CLASS
|
||||
{
|
||||
ReadDirectoryNotifyInformation=1,
|
||||
ReadDirectoryNotifyExtendedInformation
|
||||
};
|
||||
//---
|
||||
enum WELL_KNOWN_SID_TYPE
|
||||
{
|
||||
WinNullSid=0,
|
||||
WinWorldSid= 1,
|
||||
WinLocalSid= 2,
|
||||
WinCreatorOwnerSid= 3,
|
||||
WinCreatorGroupSid= 4,
|
||||
WinCreatorOwnerServerSid=5,
|
||||
WinCreatorGroupServerSid= 6,
|
||||
WinNtAuthoritySid=7,
|
||||
WinDialupSid=8,
|
||||
WinNetworkSid=9,
|
||||
WinBatchSid=10,
|
||||
WinInteractiveSid=11,
|
||||
WinServiceSid=12,
|
||||
WinAnonymousSid=13,
|
||||
WinProxySid=14,
|
||||
WinEnterpriseControllersSid=15,
|
||||
WinSelfSid=16,
|
||||
WinAuthenticatedUserSid=17,
|
||||
WinRestrictedCodeSid= 18,
|
||||
WinTerminalServerSid= 19,
|
||||
WinRemoteLogonIdSid=20,
|
||||
WinLogonIdsSid=21,
|
||||
WinLocalSystemSid=22,
|
||||
WinLocalServiceSid=23,
|
||||
WinNetworkServiceSid=24,
|
||||
WinBuiltinDomainSid=25,
|
||||
WinBuiltinAdministratorsSid=26,
|
||||
WinBuiltinUsersSid=27,
|
||||
WinBuiltinGuestsSid=28,
|
||||
WinBuiltinPowerUsersSid=29,
|
||||
WinBuiltinAccountOperatorsSid=30,
|
||||
WinBuiltinSystemOperatorsSid=31,
|
||||
WinBuiltinPrintOperatorsSid=32,
|
||||
WinBuiltinBackupOperatorsSid=33,
|
||||
WinBuiltinReplicatorSid=34,
|
||||
WinBuiltinPreWindows2000CompatibleAccessSid=35,
|
||||
WinBuiltinRemoteDesktopUsersSid=36,
|
||||
WinBuiltinNetworkConfigurationOperatorsSid=37,
|
||||
WinAccountAdministratorSid=38,
|
||||
WinAccountGuestSid=39,
|
||||
WinAccountKrbtgtSid=40,
|
||||
WinAccountDomainAdminsSid=41,
|
||||
WinAccountDomainUsersSid=42,
|
||||
WinAccountDomainGuestsSid=43,
|
||||
WinAccountComputersSid=44,
|
||||
WinAccountControllersSid=45,
|
||||
WinAccountCertAdminsSid=46,
|
||||
WinAccountSchemaAdminsSid=47,
|
||||
WinAccountEnterpriseAdminsSid=48,
|
||||
WinAccountPolicyAdminsSid=49,
|
||||
WinAccountRasAndIasServersSid=50,
|
||||
WinNTLMAuthenticationSid=51,
|
||||
WinDigestAuthenticationSid=52,
|
||||
WinSChannelAuthenticationSid=53,
|
||||
WinThisOrganizationSid=54,
|
||||
WinOtherOrganizationSid=55,
|
||||
WinBuiltinIncomingForestTrustBuildersSid=56,
|
||||
WinBuiltinPerfMonitoringUsersSid=57,
|
||||
WinBuiltinPerfLoggingUsersSid=58,
|
||||
WinBuiltinAuthorizationAccessSid=59,
|
||||
WinBuiltinTerminalServerLicenseServersSid=60,
|
||||
WinBuiltinDCOMUsersSid=61,
|
||||
WinBuiltinIUsersSid=62,
|
||||
WinIUserSid=63,
|
||||
WinBuiltinCryptoOperatorsSid=64,
|
||||
WinUntrustedLabelSid=65,
|
||||
WinLowLabelSid=66,
|
||||
WinMediumLabelSid=67,
|
||||
WinHighLabelSid=68,
|
||||
WinSystemLabelSid=69,
|
||||
WinWriteRestrictedCodeSid=70,
|
||||
WinCreatorOwnerRightsSid=71,
|
||||
WinCacheablePrincipalsGroupSid=72,
|
||||
WinNonCacheablePrincipalsGroupSid=73,
|
||||
WinEnterpriseReadonlyControllersSid=74,
|
||||
WinAccountReadonlyControllersSid=75,
|
||||
WinBuiltinEventLogReadersGroup=76,
|
||||
WinNewEnterpriseReadonlyControllersSid=77,
|
||||
WinBuiltinCertSvcDComAccessGroup=78,
|
||||
WinMediumPlusLabelSid=79,
|
||||
WinLocalLogonSid=80,
|
||||
WinConsoleLogonSid=81,
|
||||
WinThisOrganizationCertificateSid= 82,
|
||||
WinApplicationPackageAuthoritySid= 83,
|
||||
WinBuiltinAnyPackageSid=84,
|
||||
WinCapabilityInternetClientSid=85,
|
||||
WinCapabilityInternetClientServerSid=86,
|
||||
WinCapabilityPrivateNetworkClientServerSid=87,
|
||||
WinCapabilityPicturesLibrarySid=88,
|
||||
WinCapabilityVideosLibrarySid=89,
|
||||
WinCapabilityMusicLibrarySid=90,
|
||||
WinCapabilityDocumentsLibrarySid=91,
|
||||
WinCapabilitySharedUserCertificatesSid=92,
|
||||
WinCapabilityEnterpriseAuthenticationSid=93,
|
||||
WinCapabilityRemovableStorageSid=94,
|
||||
WinBuiltinRDSRemoteAccessServersSid=95,
|
||||
WinBuiltinRDSEndpointServersSid=96,
|
||||
WinBuiltinRDSManagementServersSid=97,
|
||||
WinUserModeDriversSid=98,
|
||||
WinBuiltinHyperVAdminsSid=99,
|
||||
WinAccountCloneableControllersSid=100,
|
||||
WinBuiltinAccessControlAssistanceOperatorsSid=101,
|
||||
WinBuiltinRemoteManagementUsersSid=102,
|
||||
WinAuthenticationAuthorityAssertedSid=103,
|
||||
WinAuthenticationServiceAssertedSid=104,
|
||||
WinLocalAccountSid=105,
|
||||
WinLocalAccountAndAdministratorSid=106,
|
||||
WinAccountProtectedUsersSid=107,
|
||||
WinCapabilityAppointmentsSid=108,
|
||||
WinCapabilityContactsSid=109,
|
||||
WinAccountDefaultSystemManagedSid=110,
|
||||
WinBuiltinDefaultSystemManagedGroupSid=111,
|
||||
WinBuiltinStorageReplicaAdminsSid=112,
|
||||
WinAccountKeyAdminsSid=113,
|
||||
WinAccountEnterpriseKeyAdminsSid=114,
|
||||
WinAuthenticationKeyTrustSid=115,
|
||||
WinAuthenticationKeyPropertyMFASid=116,
|
||||
WinAuthenticationKeyPropertyAttestationSid=117,
|
||||
WinAuthenticationFreshKeyAuthSid=118,
|
||||
WinBuiltinDeviceOwnersSid=119
|
||||
};
|
||||
//---
|
||||
union FILE_SEGMENT_ELEMENT
|
||||
{
|
||||
PVOID Buffer;
|
||||
ulong Alignment;
|
||||
};
|
||||
//+------------------------------------------------------------------+
|
||||
//| |
|
||||
//+------------------------------------------------------------------+
|
||||
//---
|
||||
struct REASON_CONTEXT
|
||||
{
|
||||
uint Version;
|
||||
uint Flags;
|
||||
PVOID Reason;
|
||||
};
|
||||
//---
|
||||
struct OVERLAPPED
|
||||
{
|
||||
PVOID Internal;
|
||||
PVOID InternalHigh;
|
||||
uint Offset;
|
||||
uint OffsetHigh;
|
||||
HANDLE hEvent;
|
||||
};
|
||||
//---
|
||||
struct LDT_ENTRY
|
||||
{
|
||||
ushort LimitLow;
|
||||
ushort BaseLow;
|
||||
uchar BaseMid;
|
||||
uchar Flags1;
|
||||
uchar Flags2;
|
||||
uchar BaseHi;
|
||||
};
|
||||
//---
|
||||
struct GUID
|
||||
{
|
||||
ulong Data1;
|
||||
ushort Data2;
|
||||
ushort Data3;
|
||||
uchar Data4[8];
|
||||
};
|
||||
//---
|
||||
struct FILETIME
|
||||
{
|
||||
uint dwLowDateTime;
|
||||
uint dwHighDateTime;
|
||||
};
|
||||
//---
|
||||
struct POINT
|
||||
{
|
||||
int x;
|
||||
int y;
|
||||
};
|
||||
//---
|
||||
struct POINTL
|
||||
{
|
||||
int x;
|
||||
int y;
|
||||
};
|
||||
//---
|
||||
struct POINTS
|
||||
{
|
||||
short x;
|
||||
short y;
|
||||
};
|
||||
//---
|
||||
struct RECT
|
||||
{
|
||||
int left;
|
||||
int top;
|
||||
int right;
|
||||
int bottom;
|
||||
};
|
||||
//---
|
||||
struct RECTL
|
||||
{
|
||||
int left;
|
||||
int top;
|
||||
int right;
|
||||
int bottom;
|
||||
};
|
||||
//---
|
||||
struct SIZE
|
||||
{
|
||||
int cx;
|
||||
int cy;
|
||||
};
|
||||
//---
|
||||
struct FILE_INFO
|
||||
{
|
||||
};
|
||||
//---
|
||||
struct CLAIM_SECURITY_ATTRIBUTE_V1
|
||||
{
|
||||
PVOID Name;
|
||||
ushort ValueType;
|
||||
ushort Reserved;
|
||||
uint Flags;
|
||||
uint ValueCount;
|
||||
PVOID Values;
|
||||
};
|
||||
//---
|
||||
struct CLAIM_SECURITY_ATTRIBUTES_INFORMATION
|
||||
{
|
||||
ushort Version;
|
||||
ushort Reserved;
|
||||
uint AttributeCount;
|
||||
PVOID Attribute;
|
||||
};
|
||||
//+------------------------------------------------------------------+
|
||||
+2080
File diff suppressed because it is too large
Load Diff
+3642
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,77 @@
|
||||
//+------------------------------------------------------------------+
|
||||
//| winreg.mqh |
|
||||
//| Copyright 2000-2024, MetaQuotes Ltd. |
|
||||
//| https://www.mql5.com |
|
||||
//+------------------------------------------------------------------+
|
||||
#include <WinAPI\windef.mqh>
|
||||
#include <WinAPI\winnt.mqh>
|
||||
|
||||
//---
|
||||
struct VALENTW
|
||||
{
|
||||
PVOID ve_valuename;
|
||||
uint ve_valuelen;
|
||||
uchar offset1[4];
|
||||
PVOID ve_valueptr;
|
||||
uint ve_type;
|
||||
uchar offset2[4];
|
||||
};
|
||||
//+------------------------------------------------------------------+
|
||||
//| |
|
||||
//+------------------------------------------------------------------+
|
||||
#import "advapi32.dll"
|
||||
int AbortSystemShutdownW(string machine_name);
|
||||
uint CheckForHiberboot(uchar &hiberboot,uchar clear_flag);
|
||||
uint InitiateShutdownW(string machine_name,string message,uint grace_period,uint shutdown_flags,uint reason);
|
||||
int InitiateSystemShutdownExW(string machine_name,string message,uint timeout,int force_apps_closed,int reboot_after_shutdown,uint reason);
|
||||
int InitiateSystemShutdownW(string machine_name,string message,uint timeout,int force_apps_closed,int reboot_after_shutdown);
|
||||
int RegCloseKey(HANDLE key);
|
||||
int RegConnectRegistryExW(const string machine_name,HANDLE key,uint Flags,HANDLE &result);
|
||||
int RegConnectRegistryW(const string machine_name,HANDLE key,HANDLE &result);
|
||||
int RegCopyTreeW(HANDLE key_src,const string sub_key,HANDLE key_dest);
|
||||
int RegCreateKeyExW(HANDLE key,const string sub_key,PVOID reserved,string class_name,uint options,uint desired,PVOID security_attributes,HANDLE &result,uint &disposition);
|
||||
int RegCreateKeyTransactedW(HANDLE key,const string sub_key,PVOID reserved,string class_name,uint options,uint desired,PVOID security_attributes,HANDLE &result,uint &disposition,HANDLE transaction,PVOID extended_parameter);
|
||||
int RegCreateKeyW(HANDLE key,const string sub_key,HANDLE &result);
|
||||
int RegDeleteKeyExW(HANDLE key,const string sub_key,uint desired,PVOID reserved);
|
||||
int RegDeleteKeyTransactedW(HANDLE key,const string sub_key,uint desired,PVOID reserved,HANDLE transaction,PVOID extended_parameter);
|
||||
int RegDeleteKeyValueW(HANDLE key,const string sub_key,const string value_name);
|
||||
int RegDeleteKeyW(HANDLE key,const string sub_key);
|
||||
int RegDeleteTreeW(HANDLE key,const string sub_key);
|
||||
int RegDeleteValueW(HANDLE key,const string value_name);
|
||||
int RegDisablePredefinedCache(void);
|
||||
int RegDisablePredefinedCacheEx(void);
|
||||
int RegDisableReflectionKey(HANDLE base);
|
||||
int RegEnableReflectionKey(HANDLE base);
|
||||
int RegEnumKeyExW(HANDLE key,uint index,ushort &name[],uint &name_size,PVOID reserved,ushort &class_name[],uint &class_size,FILETIME &last_write_time);
|
||||
int RegEnumKeyW(HANDLE key,uint index,ushort &name[],uint &name_size);
|
||||
int RegEnumValueW(HANDLE key,uint index,ushort &value_name[],uint &value_name_size,PVOID reserved,uint &type,uchar &data[],uint &data_size);
|
||||
int RegFlushKey(HANDLE key);
|
||||
int RegGetKeySecurity(HANDLE key,uint SecurityInformation,SECURITY_DESCRIPTOR &security_descriptor,uint &security_descriptor_size);
|
||||
int RegGetValueW(HANDLE key,const string sub_key,const string value,uint flags,uint &type,uchar &data[],uint &data_size);
|
||||
int RegLoadAppKeyW(const string file,HANDLE &result,uint desired,uint options,PVOID reserved);
|
||||
int RegLoadKeyW(HANDLE key,const string sub_key,const string file);
|
||||
int RegLoadMUIStringW(HANDLE key,const string value,ushort &out_buf[],uint &out_buf_size,uint &data,uint flags,const string directory);
|
||||
int RegNotifyChangeKeyValue(HANDLE key,int watch_subtree,uint notify_filter,HANDLE event,int asynchronous);
|
||||
int RegOpenCurrentUser(uint desired,HANDLE &result);
|
||||
int RegOpenKeyExW(HANDLE key,const string sub_key,uint options,uint desired,HANDLE &result);
|
||||
int RegOpenKeyTransactedW(HANDLE key,const string sub_key,uint options,uint desired,HANDLE &result,HANDLE transaction,PVOID extended_paremeter);
|
||||
int RegOpenKeyW(HANDLE key,const string sub_key,HANDLE &result);
|
||||
int RegOpenUserClassesRoot(HANDLE token,uint options,uint desired,HANDLE &result);
|
||||
int RegOverridePredefKey(HANDLE key,HANDLE new_key);
|
||||
int RegQueryInfoKeyW(HANDLE key,string class_name,uint &class_size,PVOID reserved,uint &sub_keys,uint &max_sub_key_len,uint &max_class_len,uint &values,uint &max_value_name_len,uint &max_value_len,uint &security_descriptor,FILETIME &last_write_time);
|
||||
int RegQueryMultipleValuesW(HANDLE key,VALENTW &val_list[],uint num_vals,ushort &value_buf[],uint &totsize);
|
||||
int RegQueryReflectionKey(HANDLE base,int &is_reflection_disabled);
|
||||
int RegQueryValueExW(HANDLE key,const string value_name,PVOID reserved,uint &type,uchar &data[],uint &data_size);
|
||||
int RegQueryValueW(HANDLE key,const string sub_key,uchar &data[],uint &data_size);
|
||||
int RegRenameKey(HANDLE key,const string sub_key_name,const string new_key_name);
|
||||
int RegReplaceKeyW(HANDLE key,const string sub_key,const string new_file,const string old_file);
|
||||
int RegRestoreKeyW(HANDLE key,const string file,uint flags);
|
||||
int RegSaveKeyExW(HANDLE key,const string file,PVOID security_attributes,uint flags);
|
||||
int RegSaveKeyW(HANDLE key,const string file,PVOID security_attributes);
|
||||
int RegSetKeySecurity(HANDLE key,uint SecurityInformation,SECURITY_DESCRIPTOR &security_descriptor);
|
||||
int RegSetKeyValueW(HANDLE key,const string sub_key,const string value_name,uint type,const uchar &data[],uint data);
|
||||
int RegSetValueExW(HANDLE key,const string value_name,PVOID reserved,uint type,const uchar &data[],uint data_size);
|
||||
int RegSetValueW(HANDLE key,const string sub_key,uint type,const ushort &data[],uint data_size);
|
||||
int RegUnLoadKeyW(HANDLE key,const string sub_key);
|
||||
#import
|
||||
//+------------------------------------------------------------------+
|
||||
+1825
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user