Home | History | Annotate | Download | only in include
      1 /**
      2  * This file is part of the mingw-w64 runtime package.
      3  * No warranty is given; refer to the file DISCLAIMER within this package.
      4  */
      5 #ifndef _SYSINFOAPI_H_
      6 #define _SYSINFOAPI_H_
      7 
      8 #include <apiset.h>
      9 #include <apisetcconv.h>
     10 #include <minwindef.h>
     11 #include <minwinbase.h>
     12 
     13 #ifdef __cplusplus
     14 extern "C" {
     15 #endif
     16 
     17 #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_APP)
     18   typedef struct _SYSTEM_INFO {
     19     __C89_NAMELESS union {
     20       DWORD dwOemId;
     21       __C89_NAMELESS struct {
     22 	WORD wProcessorArchitecture;
     23 	WORD wReserved;
     24       } DUMMYSTRUCTNAME;
     25     } DUMMYUNIONNAME;
     26     DWORD dwPageSize;
     27     LPVOID lpMinimumApplicationAddress;
     28     LPVOID lpMaximumApplicationAddress;
     29     DWORD_PTR dwActiveProcessorMask;
     30     DWORD dwNumberOfProcessors;
     31     DWORD dwProcessorType;
     32     DWORD dwAllocationGranularity;
     33     WORD wProcessorLevel;
     34     WORD wProcessorRevision;
     35   } SYSTEM_INFO, *LPSYSTEM_INFO;
     36 
     37   WINBASEAPI VOID WINAPI GetSystemTime (LPSYSTEMTIME lpSystemTime);
     38   WINBASEAPI VOID WINAPI GetSystemTimeAsFileTime (LPFILETIME lpSystemTimeAsFileTime);
     39   WINBASEAPI VOID WINAPI GetLocalTime (LPSYSTEMTIME lpSystemTime);
     40   WINBASEAPI VOID WINAPI GetNativeSystemInfo (LPSYSTEM_INFO lpSystemInfo);
     41 #if _WIN32_WINNT >= 0x0600
     42   WINBASEAPI ULONGLONG WINAPI GetTickCount64 (VOID);
     43 #endif
     44 #endif
     45 
     46 #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
     47   WINBASEAPI DWORD WINAPI GetVersion (VOID);
     48 
     49   typedef struct _MEMORYSTATUSEX {
     50     DWORD dwLength;
     51     DWORD dwMemoryLoad;
     52     DWORDLONG ullTotalPhys;
     53     DWORDLONG ullAvailPhys;
     54     DWORDLONG ullTotalPageFile;
     55     DWORDLONG ullAvailPageFile;
     56     DWORDLONG ullTotalVirtual;
     57     DWORDLONG ullAvailVirtual;
     58     DWORDLONG ullAvailExtendedVirtual;
     59   } MEMORYSTATUSEX,*LPMEMORYSTATUSEX;
     60 
     61   typedef enum _COMPUTER_NAME_FORMAT {
     62     ComputerNameNetBIOS,
     63     ComputerNameDnsHostname,
     64     ComputerNameDnsDomain,
     65     ComputerNameDnsFullyQualified,
     66     ComputerNamePhysicalNetBIOS,
     67     ComputerNamePhysicalDnsHostname,
     68     ComputerNamePhysicalDnsDomain,
     69     ComputerNamePhysicalDnsFullyQualified,
     70     ComputerNameMax
     71   } COMPUTER_NAME_FORMAT;
     72 
     73   WINBASEAPI WINBOOL WINAPI GlobalMemoryStatusEx (LPMEMORYSTATUSEX lpBuffer);
     74   WINBASEAPI WINBOOL WINAPI SetLocalTime (CONST SYSTEMTIME *lpSystemTime);
     75   WINBASEAPI VOID WINAPI GetSystemInfo (LPSYSTEM_INFO lpSystemInfo);
     76   WINBASEAPI DWORD WINAPI GetTickCount (VOID);
     77   WINBASEAPI WINBOOL WINAPI GetSystemTimeAdjustment (PDWORD lpTimeAdjustment, PDWORD lpTimeIncrement, PBOOL lpTimeAdjustmentDisabled);
     78   WINBASEAPI UINT WINAPI GetSystemDirectoryA (LPSTR lpBuffer, UINT uSize);
     79   WINBASEAPI UINT WINAPI GetSystemDirectoryW (LPWSTR lpBuffer, UINT uSize);
     80   WINBASEAPI UINT WINAPI GetWindowsDirectoryA (LPSTR lpBuffer, UINT uSize);
     81   WINBASEAPI UINT WINAPI GetWindowsDirectoryW (LPWSTR lpBuffer, UINT uSize);
     82   WINBASEAPI UINT WINAPI GetSystemWindowsDirectoryA (LPSTR lpBuffer, UINT uSize);
     83   WINBASEAPI UINT WINAPI GetSystemWindowsDirectoryW (LPWSTR lpBuffer, UINT uSize);
     84   WINBASEAPI WINBOOL WINAPI GetComputerNameExA (COMPUTER_NAME_FORMAT NameType, LPSTR lpBuffer, LPDWORD nSize);
     85   WINBASEAPI WINBOOL WINAPI GetComputerNameExW (COMPUTER_NAME_FORMAT NameType, LPWSTR lpBuffer, LPDWORD nSize);
     86   WINBASEAPI WINBOOL WINAPI SetComputerNameExW (COMPUTER_NAME_FORMAT NameType, LPCWSTR lpBuffer);
     87   WINBASEAPI WINBOOL WINAPI SetSystemTime (CONST SYSTEMTIME *lpSystemTime);
     88   WINBASEAPI WINBOOL WINAPI GetVersionExA (LPOSVERSIONINFOA lpVersionInformation);
     89   WINBASEAPI WINBOOL WINAPI GetVersionExW (LPOSVERSIONINFOW lpVersionInformation);
     90   WINBASEAPI WINBOOL WINAPI GetLogicalProcessorInformation (PSYSTEM_LOGICAL_PROCESSOR_INFORMATION Buffer, PDWORD ReturnedLength);
     91   NTSYSAPI ULONGLONG NTAPI VerSetConditionMask (ULONGLONG ConditionMask, ULONG TypeMask, UCHAR Condition);
     92   WINBASEAPI VOID WINAPI GetSystemTimePreciseAsFileTime (LPFILETIME lpSystemTimeAsFileTime);
     93   WINBASEAPI UINT WINAPI EnumSystemFirmwareTables (DWORD FirmwareTableProviderSignature, PVOID pFirmwareTableEnumBuffer, DWORD BufferSize);
     94   WINBASEAPI UINT WINAPI GetSystemFirmwareTable (DWORD FirmwareTableProviderSignature, DWORD FirmwareTableID, PVOID pFirmwareTableBuffer, DWORD BufferSize);
     95 #if _WIN32_WINNT >= 0x0600
     96   WINBASEAPI WINBOOL WINAPI GetProductInfo (DWORD dwOSMajorVersion, DWORD dwOSMinorVersion, DWORD dwSpMajorVersion, DWORD dwSpMinorVersion, PDWORD pdwReturnedProductType);
     97 #endif
     98 #if _WIN32_WINNT >= 0x0601
     99   WINBASEAPI WINBOOL WINAPI GetLogicalProcessorInformationEx (LOGICAL_PROCESSOR_RELATIONSHIP RelationshipType, PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX Buffer, PDWORD ReturnedLength);
    100   WINBASEAPI WINBOOL WINAPI GetOsSafeBootMode (PDWORD Flags);
    101 #endif
    102 
    103 #define GetSystemDirectory __MINGW_NAME_AW(GetSystemDirectory)
    104 #define GetWindowsDirectory __MINGW_NAME_AW(GetWindowsDirectory)
    105 #define GetSystemWindowsDirectory __MINGW_NAME_AW(GetSystemWindowsDirectory)
    106 #define GetComputerNameEx __MINGW_NAME_AW(GetComputerNameEx)
    107 #define GetVersionEx __MINGW_NAME_AW(GetVersionEx)
    108 
    109 #ifdef UNICODE
    110 #define SetComputerNameEx SetComputerNameExW
    111 #endif
    112 #endif
    113 
    114 #ifdef __cplusplus
    115 }
    116 #endif
    117 #endif
    118