mirror of
https://github.com/hakril/PythonForWindows
synced 2026-06-08 14:31:45 +00:00
Added Multiple function / define to generated def
This commit is contained in:
@@ -8,4 +8,39 @@
|
||||
|
||||
#define HKEY_CURRENT_CONFIG (0x80000005)
|
||||
#define HKEY_DYN_DATA (0x80000006)
|
||||
#define HKEY_CURRENT_USER_LOCAL_SETTINGS (0x80000007)
|
||||
#define HKEY_CURRENT_USER_LOCAL_SETTINGS (0x80000007)
|
||||
|
||||
/* From: public/sdk/inc/ntregapi.h */
|
||||
|
||||
#define REG_OPTION_RESERVED (0x00000000L) // Parameter is reserved
|
||||
|
||||
#define REG_OPTION_NON_VOLATILE (0x00000000L) // Key is preserved
|
||||
// when system is rebooted
|
||||
|
||||
#define REG_OPTION_VOLATILE (0x00000001L) // Key is not preserved
|
||||
// when system is rebooted
|
||||
|
||||
#define REG_OPTION_CREATE_LINK (0x00000002L) // Created key is a
|
||||
// symbolic link
|
||||
|
||||
#define REG_OPTION_BACKUP_RESTORE (0x00000004L) // open for backup or restore
|
||||
// special access rules
|
||||
// privilege required
|
||||
|
||||
#define REG_OPTION_OPEN_LINK (0x00000008L) // Open symbolic link
|
||||
|
||||
#define REG_LEGAL_OPTION \
|
||||
(REG_OPTION_RESERVED |\
|
||||
REG_OPTION_NON_VOLATILE |\
|
||||
REG_OPTION_VOLATILE |\
|
||||
REG_OPTION_CREATE_LINK |\
|
||||
REG_OPTION_BACKUP_RESTORE |\
|
||||
REG_OPTION_OPEN_LINK)
|
||||
|
||||
|
||||
//
|
||||
// hive format to be used by Reg(Nt)SaveKeyEx
|
||||
//
|
||||
#define REG_STANDARD_FORMAT 1
|
||||
#define REG_LATEST_FORMAT 2
|
||||
#define REG_NO_COMPRESSION 4
|
||||
@@ -0,0 +1,26 @@
|
||||
// Shell File Operations
|
||||
|
||||
#define FO_MOVE 0x0001
|
||||
#define FO_COPY 0x0002
|
||||
#define FO_DELETE 0x0003
|
||||
#define FO_RENAME 0x0004
|
||||
|
||||
|
||||
#define FOF_MULTIDESTFILES 0x0001
|
||||
#define FOF_CONFIRMMOUSE 0x0002
|
||||
#define FOF_SILENT 0x0004 // don't display progress UI (confirm prompts may be displayed still)
|
||||
#define FOF_RENAMEONCOLLISION 0x0008 // automatically rename the source files to avoid the collisions
|
||||
#define FOF_NOCONFIRMATION 0x0010 // don't display confirmation UI, assume "yes" for cases that can be bypassed, "no" for those that can not
|
||||
#define FOF_WANTMAPPINGHANDLE 0x0020 // Fill in SHFILEOPSTRUCT.hNameMappings
|
||||
// Must be freed using SHFreeNameMappings
|
||||
#define FOF_ALLOWUNDO 0x0040 // enable undo including Recycle behavior for IFileOperation::Delete()
|
||||
#define FOF_FILESONLY 0x0080 // only operate on the files (non folders), both files and folders are assumed without this
|
||||
#define FOF_SIMPLEPROGRESS 0x0100 // means don't show names of files
|
||||
#define FOF_NOCONFIRMMKDIR 0x0200 // don't dispplay confirmatino UI before making any needed directories, assume "Yes" in these cases
|
||||
#define FOF_NOERRORUI 0x0400 // don't put up error UI, other UI may be displayed, progress, confirmations
|
||||
#define FOF_NOCOPYSECURITYATTRIBS 0x0800 // dont copy file security attributes (ACLs)
|
||||
#define FOF_NORECURSION 0x1000 // don't recurse into directories for operations that would recurse
|
||||
#define FOF_NO_CONNECTED_ELEMENTS 0x2000 // don't operate on connected elements ("xxx_files" folders that go with .htm files)
|
||||
#define FOF_WANTNUKEWARNING 0x4000 // during delete operation, warn if object is being permanently destroyed instead of recycling (partially overrides FOF_NOCONFIRMATION)
|
||||
#define FOF_NORECURSEREPARSE 0x8000 // deprecated; the operations engine always does the right thing on FolderLink objects (symlinks, reparse points, folder shortcuts)
|
||||
#define FOF_NO_UI (FOF_SILENT | FOF_NOCONFIRMATION | FOF_NOERRORUI | FOF_NOCONFIRMMKDIR) // don't display any UI at all
|
||||
@@ -385,38 +385,6 @@
|
||||
#define IMAGE_FILE_UP_SYSTEM_ONLY 0x4000
|
||||
#define IMAGE_FILE_BYTES_REVERSED_HI 0x8000
|
||||
|
||||
#define IMAGE_FILE_MACHINE_UNKNOWN 0
|
||||
#define IMAGE_FILE_MACHINE_I386 0x014c
|
||||
#define IMAGE_FILE_MACHINE_R3000 0x0162
|
||||
#define IMAGE_FILE_MACHINE_R4000 0x0166
|
||||
#define IMAGE_FILE_MACHINE_R10000 0x0168
|
||||
#define IMAGE_FILE_MACHINE_WCEMIPSV2 0x0169
|
||||
#define IMAGE_FILE_MACHINE_ALPHA 0x0184
|
||||
#define IMAGE_FILE_MACHINE_SH3 0x01a2
|
||||
#define IMAGE_FILE_MACHINE_SH3DSP 0x01a3
|
||||
#define IMAGE_FILE_MACHINE_SH3E 0x01a4
|
||||
#define IMAGE_FILE_MACHINE_SH4 0x01a6
|
||||
#define IMAGE_FILE_MACHINE_SH5 0x01a8
|
||||
#define IMAGE_FILE_MACHINE_ARM 0x01c0
|
||||
#define IMAGE_FILE_MACHINE_THUMB 0x01c2
|
||||
#define IMAGE_FILE_MACHINE_ARMNT 0x01c4
|
||||
#define IMAGE_FILE_MACHINE_AM33 0x01d3
|
||||
#define IMAGE_FILE_MACHINE_POWERPC 0x01F0
|
||||
#define IMAGE_FILE_MACHINE_POWERPCFP 0x01f1
|
||||
#define IMAGE_FILE_MACHINE_IA64 0x0200
|
||||
#define IMAGE_FILE_MACHINE_MIPS16 0x0266
|
||||
#define IMAGE_FILE_MACHINE_ALPHA64 0x0284
|
||||
#define IMAGE_FILE_MACHINE_MIPSFPU 0x0366
|
||||
#define IMAGE_FILE_MACHINE_MIPSFPU16 0x0466
|
||||
#define IMAGE_FILE_MACHINE_AXP64 IMAGE_FILE_MACHINE_ALPHA64
|
||||
#define IMAGE_FILE_MACHINE_TRICORE 0x0520
|
||||
#define IMAGE_FILE_MACHINE_CEF 0x0CEF
|
||||
#define IMAGE_FILE_MACHINE_EBC 0x0EBC
|
||||
#define IMAGE_FILE_MACHINE_AMD64 0x8664
|
||||
#define IMAGE_FILE_MACHINE_M32R 0x9041
|
||||
#define IMAGE_FILE_MACHINE_CEE 0xC0EE
|
||||
|
||||
|
||||
|
||||
#define SECURITY_MANDATORY_UNTRUSTED_RID (0x00000000L)
|
||||
#define SECURITY_MANDATORY_LOW_RID (0x00001000L)
|
||||
|
||||
@@ -46,4 +46,58 @@
|
||||
#define IMAGE_REL_BASED_MACHINE_SPECIFIC_7 7
|
||||
#define IMAGE_REL_BASED_MACHINE_SPECIFIC_8 8
|
||||
#define IMAGE_REL_BASED_MACHINE_SPECIFIC_9 9
|
||||
#define IMAGE_REL_BASED_DIR64 10
|
||||
#define IMAGE_REL_BASED_DIR64 10
|
||||
|
||||
// Security Directory related
|
||||
|
||||
#define WIN_CERT_REVISION_1_0 (0x0100)
|
||||
#define WIN_CERT_REVISION_2_0 (0x0200)
|
||||
|
||||
#define WIN_CERT_TYPE_X509 (0x0001) // bCertificate contains an X.509 Certificate
|
||||
#define WIN_CERT_TYPE_PKCS_SIGNED_DATA (0x0002) // bCertificate contains a PKCS SignedData structure
|
||||
#define WIN_CERT_TYPE_RESERVED_1 (0x0003) // Reserved
|
||||
#define WIN_CERT_TYPE_TS_STACK_SIGNED (0x0004) // Terminal Server Protocol Stack Certificate signing
|
||||
|
||||
// Optional Header related
|
||||
|
||||
#define IMAGE_SIZEOF_ROM_OPTIONAL_HEADER 56
|
||||
#define IMAGE_SIZEOF_STD_OPTIONAL_HEADER 28
|
||||
#define IMAGE_SIZEOF_NT_OPTIONAL32_HEADER 224
|
||||
#define IMAGE_SIZEOF_NT_OPTIONAL64_HEADER 240
|
||||
|
||||
#define IMAGE_NT_OPTIONAL_HDR32_MAGIC 0x10b
|
||||
#define IMAGE_NT_OPTIONAL_HDR64_MAGIC 0x20b
|
||||
#define IMAGE_ROM_OPTIONAL_HDR_MAGIC 0x107
|
||||
|
||||
|
||||
#define IMAGE_FILE_MACHINE_UNKNOWN 0
|
||||
#define IMAGE_FILE_MACHINE_I386 0x014c
|
||||
#define IMAGE_FILE_MACHINE_R3000 0x0162
|
||||
#define IMAGE_FILE_MACHINE_R4000 0x0166
|
||||
#define IMAGE_FILE_MACHINE_R10000 0x0168
|
||||
#define IMAGE_FILE_MACHINE_WCEMIPSV2 0x0169
|
||||
#define IMAGE_FILE_MACHINE_ALPHA 0x0184
|
||||
#define IMAGE_FILE_MACHINE_SH3 0x01a2
|
||||
#define IMAGE_FILE_MACHINE_SH3DSP 0x01a3
|
||||
#define IMAGE_FILE_MACHINE_SH3E 0x01a4
|
||||
#define IMAGE_FILE_MACHINE_SH4 0x01a6
|
||||
#define IMAGE_FILE_MACHINE_SH5 0x01a8
|
||||
#define IMAGE_FILE_MACHINE_ARM 0x01c0
|
||||
#define IMAGE_FILE_MACHINE_THUMB 0x01c2
|
||||
#define IMAGE_FILE_MACHINE_ARMNT 0x01c4
|
||||
#define IMAGE_FILE_MACHINE_AM33 0x01d3
|
||||
#define IMAGE_FILE_MACHINE_POWERPC 0x01F0
|
||||
#define IMAGE_FILE_MACHINE_POWERPCFP 0x01f1
|
||||
#define IMAGE_FILE_MACHINE_IA64 0x0200
|
||||
#define IMAGE_FILE_MACHINE_MIPS16 0x0266
|
||||
#define IMAGE_FILE_MACHINE_ALPHA64 0x0284
|
||||
#define IMAGE_FILE_MACHINE_MIPSFPU 0x0366
|
||||
#define IMAGE_FILE_MACHINE_MIPSFPU16 0x0466
|
||||
#define IMAGE_FILE_MACHINE_AXP64 IMAGE_FILE_MACHINE_ALPHA64
|
||||
#define IMAGE_FILE_MACHINE_TRICORE 0x0520
|
||||
#define IMAGE_FILE_MACHINE_CEF 0x0CEF
|
||||
#define IMAGE_FILE_MACHINE_EBC 0x0EBC
|
||||
#define IMAGE_FILE_MACHINE_AMD64 0x8664
|
||||
#define IMAGE_FILE_MACHINE_M32R 0x9041
|
||||
#define IMAGE_FILE_MACHINE_CEE 0xC0EE
|
||||
#define IMAGE_FILE_MACHINE_ARM64 0xAA64
|
||||
@@ -0,0 +1,5 @@
|
||||
ULONG GetIpNetTable(
|
||||
PMIB_IPNETTABLE IpNetTable,
|
||||
PULONG SizePointer,
|
||||
BOOL Order
|
||||
);
|
||||
@@ -253,4 +253,33 @@ LSTATUS RegDeleteTreeA(
|
||||
LSTATUS RegDeleteTreeW(
|
||||
HKEY hKey,
|
||||
LPCWSTR lpSubKey
|
||||
);
|
||||
|
||||
|
||||
LSTATUS RegSaveKeyA(
|
||||
HKEY hKey,
|
||||
LPCSTR lpFile,
|
||||
LPSECURITY_ATTRIBUTES lpSecurityAttributes
|
||||
);
|
||||
|
||||
LSTATUS RegSaveKeyW(
|
||||
HKEY hKey,
|
||||
LPCWSTR lpFile,
|
||||
LPSECURITY_ATTRIBUTES lpSecurityAttributes
|
||||
);
|
||||
|
||||
|
||||
LSTATUS RegSaveKeyExA(
|
||||
HKEY hKey,
|
||||
LPCSTR lpFile,
|
||||
LPSECURITY_ATTRIBUTES lpSecurityAttributes,
|
||||
DWORD Flags
|
||||
);
|
||||
|
||||
|
||||
LSTATUS RegSaveKeyExW(
|
||||
HKEY hKey,
|
||||
LPCWSTR lpFile,
|
||||
LPSECURITY_ATTRIBUTES lpSecurityAttributes,
|
||||
DWORD Flags
|
||||
);
|
||||
@@ -26,4 +26,8 @@ BOOL SHGetPathFromIDListA(
|
||||
BOOL SHGetPathFromIDListW(
|
||||
PCIDLIST_ABSOLUTE pidl,
|
||||
LPWSTR pszPath
|
||||
);
|
||||
|
||||
INT SHFileOperationA(
|
||||
LPSHFILEOPSTRUCTA lpFileOp
|
||||
);
|
||||
@@ -795,6 +795,17 @@ NTSTATUS RtlDecompressBuffer(
|
||||
PULONG FinalUncompressedSize
|
||||
);
|
||||
|
||||
NTSTATUS RtlCompressBuffer(
|
||||
USHORT CompressionFormatAndEngine,
|
||||
PUCHAR UncompressedBuffer,
|
||||
ULONG UncompressedBufferSize,
|
||||
PUCHAR CompressedBuffer,
|
||||
ULONG CompressedBufferSize,
|
||||
ULONG UncompressedChunkSize,
|
||||
PULONG FinalCompressedSize,
|
||||
PVOID WorkSpace
|
||||
);
|
||||
|
||||
NTSTATUS RtlDecompressBufferEx(
|
||||
USHORT CompressionFormat,
|
||||
PUCHAR UncompressedBuffer,
|
||||
|
||||
@@ -82,6 +82,7 @@ SPC_UUID = BYTE * 16
|
||||
DEVICE_TYPE = DWORD
|
||||
PWINDBG_EXTENSION_APIS32 = PVOID
|
||||
PWINDBG_EXTENSION_APIS64 = PVOID
|
||||
FILEOP_FLAGS = WORD
|
||||
|
||||
|
||||
NCRYPT_HANDLE = ULONG_PTR
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
typedef struct _MIB_IPNETROW_LH {
|
||||
IF_INDEX dwIndex;
|
||||
DWORD dwPhysAddrLen;
|
||||
UCHAR bPhysAddr[8];
|
||||
DWORD dwAddr;
|
||||
union {
|
||||
DWORD dwType;
|
||||
};
|
||||
} MIB_IPNETROW, *PMIB_IPNETROW;
|
||||
|
||||
typedef struct _MIB_IPNETTABLE {
|
||||
DWORD dwNumEntries;
|
||||
MIB_IPNETROW table[ANY_SIZE];
|
||||
} MIB_IPNETTABLE, *PMIB_IPNETTABLE;
|
||||
@@ -29,4 +29,15 @@ enum PACKAGE_EXECUTION_STATE
|
||||
PES_SUSPENDING = 2,
|
||||
PES_SUSPENDED = 3,
|
||||
PES_TERMINATED = 4
|
||||
} PACKAGE_EXECUTION_STATE;
|
||||
} PACKAGE_EXECUTION_STATE;
|
||||
|
||||
typedef struct _SHFILEOPSTRUCTA {
|
||||
HWND hwnd;
|
||||
UINT wFunc;
|
||||
PCSTR pFrom;
|
||||
PCSTR pTo;
|
||||
FILEOP_FLAGS fFlags;
|
||||
BOOL fAnyOperationsAborted;
|
||||
LPVOID hNameMappings;
|
||||
PCSTR lpszProgressTitle;
|
||||
} SHFILEOPSTRUCTA, *LPSHFILEOPSTRUCTA;
|
||||
@@ -882,6 +882,17 @@ typedef struct _IMAGE_EXPORT_DIRECTORY {
|
||||
DWORD AddressOfNameOrdinals;
|
||||
} IMAGE_EXPORT_DIRECTORY, *PIMAGE_EXPORT_DIRECTORY;
|
||||
|
||||
typedef struct _IMAGE_DEBUG_DIRECTORY {
|
||||
DWORD Characteristics;
|
||||
DWORD TimeDateStamp;
|
||||
WORD MajorVersion;
|
||||
WORD MinorVersion;
|
||||
DWORD Type;
|
||||
DWORD SizeOfData;
|
||||
DWORD AddressOfRawData;
|
||||
DWORD PointerToRawData;
|
||||
} IMAGE_DEBUG_DIRECTORY, *PIMAGE_DEBUG_DIRECTORY;
|
||||
|
||||
typedef struct _IMAGE_BASE_RELOCATION {
|
||||
DWORD VirtualAddress;
|
||||
DWORD SizeOfBlock;
|
||||
|
||||
+1677
-1632
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
+1677
-1632
File diff suppressed because it is too large
Load Diff
+1777
-1742
File diff suppressed because it is too large
Load Diff
+4788
-4734
File diff suppressed because it is too large
Load Diff
@@ -360,6 +360,21 @@ def RegEnumValueA(hKey, dwIndex, lpValueName, lpcchValueName, lpReserved, lpType
|
||||
def RegEnumValueW(hKey, dwIndex, lpValueName, lpcchValueName, lpReserved, lpType, lpData, lpcbData):
|
||||
return RegEnumValueW.ctypes_function(hKey, dwIndex, lpValueName, lpcchValueName, lpReserved, lpType, lpData, lpcbData)
|
||||
|
||||
@Advapi32Proxy(error_check=result_is_error_code)
|
||||
def RegSaveKeyA(hKey, lpFile, lpSecurityAttributes):
|
||||
return RegSaveKeyA.ctypes_function(hKey, lpFile, lpSecurityAttributes)
|
||||
|
||||
@Advapi32Proxy(error_check=result_is_error_code)
|
||||
def RegSaveKeyW(hKey, lpFile, lpSecurityAttributes):
|
||||
return RegSaveKeyW.ctypes_function(hKey, lpFile, lpSecurityAttributes)
|
||||
|
||||
@Advapi32Proxy(error_check=result_is_error_code)
|
||||
def RegSaveKeyExA(hKey, lpFile, lpSecurityAttributes, Flags):
|
||||
return RegSaveKeyExA.ctypes_function(hKey, lpFile, lpSecurityAttributes, Flags)
|
||||
|
||||
@Advapi32Proxy(error_check=result_is_error_code)
|
||||
def RegSaveKeyExW(hKey, lpFile, lpSecurityAttributes, Flags):
|
||||
return RegSaveKeyExW.ctypes_function(hKey, lpFile, lpSecurityAttributes, Flags)
|
||||
|
||||
# Service
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import ctypes
|
||||
import windows.generated_def as gdef
|
||||
|
||||
from ..apiproxy import ApiProxy, NeededParameter
|
||||
from ..error import fail_on_zero, result_is_error_code
|
||||
from ..error import fail_on_zero, result_is_error_code, no_error_check
|
||||
|
||||
class DNSapiProxy(ApiProxy):
|
||||
APIDLL = "dnsapi"
|
||||
@@ -23,6 +23,6 @@ def DnsQuery_A(pszName, wType, Options, pExtra, ppQueryResults, pReserved):
|
||||
def DnsQuery_W(pszName, wType, Options, pExtra, ppQueryResults, pReserved):
|
||||
return DnsQuery_W.ctypes_function(pszName, wType, Options, pExtra, ppQueryResults, pReserved)
|
||||
|
||||
@DNSapiProxy()
|
||||
@DNSapiProxy(error_check=no_error_check)
|
||||
def DnsFree(pData, FreeType):
|
||||
return DnsFree.ctypes_function(pData, FreeType)
|
||||
|
||||
@@ -32,3 +32,8 @@ def GetIfTable(pIfTable, pdwSize, bOrder=False):
|
||||
@IphlpapiProxy()
|
||||
def GetIpAddrTable(pIpAddrTable, pdwSize, bOrder=False):
|
||||
return GetIpAddrTable.ctypes_function(pIpAddrTable, pdwSize, bOrder)
|
||||
|
||||
|
||||
@IphlpapiProxy()
|
||||
def GetIpNetTable(IpNetTable, SizePointer, Order):
|
||||
return GetIpNetTable.ctypes_function(IpNetTable, SizePointer, Order)
|
||||
@@ -318,6 +318,10 @@ def RtlDecompressBufferEx(CompressionFormat, UncompressedBuffer, UncompressedBuf
|
||||
def RtlGetCompressionWorkSpaceSize(CompressionFormatAndEngine, CompressBufferWorkSpaceSize, CompressFragmentWorkSpaceSize):
|
||||
return RtlGetCompressionWorkSpaceSize.ctypes_function(CompressionFormatAndEngine, CompressBufferWorkSpaceSize, CompressFragmentWorkSpaceSize)
|
||||
|
||||
@NtdllProxy()
|
||||
def RtlCompressBuffer(CompressionFormatAndEngine, UncompressedBuffer, UncompressedBufferSize, CompressedBuffer, CompressedBufferSize, UncompressedChunkSize=4096, FinalCompressedSize=NeededParameter, WorkSpace=NeededParameter):
|
||||
return RtlCompressBuffer.ctypes_function(CompressionFormatAndEngine, UncompressedBuffer, UncompressedBufferSize, CompressedBuffer, CompressedBufferSize, UncompressedChunkSize, FinalCompressedSize, WorkSpace)
|
||||
|
||||
|
||||
# Section
|
||||
|
||||
@@ -384,7 +388,6 @@ def RtlEqualUnicodeString(String1, String2, CaseInSensitive):
|
||||
|
||||
|
||||
# Firmware
|
||||
|
||||
@NtdllProxy()
|
||||
def NtEnumerateSystemEnvironmentValuesEx(InformationClass, Buffer, BufferLength):
|
||||
return NtEnumerateSystemEnvironmentValuesEx.ctypes_function(InformationClass, Buffer, BufferLength)
|
||||
|
||||
@@ -2,7 +2,7 @@ import ctypes
|
||||
import windows.generated_def as gdef
|
||||
|
||||
from ..apiproxy import ApiProxy, NeededParameter
|
||||
from ..error import fail_on_zero
|
||||
from ..error import fail_on_zero, succeed_on_zero
|
||||
|
||||
class Shell32Proxy(ApiProxy):
|
||||
APIDLL = "shell32"
|
||||
@@ -22,4 +22,8 @@ def SHGetPathFromIDListA(pidl, pszPath):
|
||||
|
||||
@Shell32Proxy()
|
||||
def SHGetPathFromIDListW(pidl, pszPath):
|
||||
return SHGetPathFromIDListW.ctypes_function(pidl, pszPath)
|
||||
return SHGetPathFromIDListW.ctypes_function(pidl, pszPath)
|
||||
|
||||
@Shell32Proxy(error_check=succeed_on_zero)
|
||||
def SHFileOperationA(lpFileOp):
|
||||
return SHFileOperationA.ctypes_function(lpFileOp)
|
||||
Reference in New Issue
Block a user