34#define BUFFER_SIZE 1024
41 DWORD dwBytes = cchBuf*
sizeof(
WCHAR), dwType = 0;
63 wprintf(
L"Warning! Cannot query %s. Last error: %lu, type: %lu.\n", lpValueName,
GetLastError(), dwType);
66 else if (dwBytes == 0)
93 DWORD dwBytes =
sizeof(*lpData), dwType;
115 wprintf(
L"Warning! Cannot query %s. Last err: %lu, type: %lu\n", lpValueName,
GetLastError(), dwType);
136 _itow(cBytes / (1024*1024), szMB, 10);
141 fmt.lpDecimalSep =
L"";
142 fmt.lpThousandSep =
L" ";
143 fmt.NegativeOrder = 0;
158 const struct tm *lpTm;
275 const WCHAR *lpcszSysType;
279 unsigned int cSeconds,
i,
j;
289 wprintf(
L"Error! GetSystemDirectory failed.\n");
298 wprintf(
L"Error! GetComputerName failed.\n");
304 L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion",
309 wprintf(
L"Error! RegOpenKeyEx failed.\n");
326 L"%lu.%lu.%lu %s %s %lu",
366 swprintf(Buf, Tmp, cSeconds / (60*60*24), (cSeconds / (60*60)) % 24, (cSeconds / 60) % 60, cSeconds % 60);
373 swprintf(Tmp,
L"%s\\oeminfo.ini", szSystemDir);
378 sizeof(Buf)/
sizeof(Buf[0]),
380 if (
wcslen(Buf) == 0 && SMBiosBuf)
391 sizeof(Buf)/
sizeof(Buf[0]),
393 if (
wcslen(Buf) == 0 && SMBiosBuf)
403 lpcszSysType =
L"X86-based PC";
406 lpcszSysType =
L"IA64-based PC";
409 lpcszSysType =
L"AMD64-based PC";
412 lpcszSysType =
L"Unknown";
424 swprintf(Tmp,
L"HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\%u",
i);
449 L"HARDWARE\\DESCRIPTION\\System",
450 L"SystemBiosVersion",
464 L"HARDWARE\\DESCRIPTION\\System",
476 wprintf(
L"Error! GetWindowsDirectory failed.");
494 L"MIME\\Database\\Rfc1766",
509 L"Keyboard Layout\\Preload",
514 L"MIME\\Database\\Rfc1766",
532 L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones",
580 L"SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Memory Management",
587 for(
i = 0; Buf[
i];
i++)
612 pAdapters =
malloc(cbAdapters);
622 unsigned cAdapters = 0;
625 for(
i = 0; pCurrentAdapter; ++
i)
627 if (pCurrentAdapter->IfType != 24 && pCurrentAdapter->IfType != 131)
629 pCurrentAdapter = pCurrentAdapter->Next;
640 pCurrentAdapter = pAdapters;
641 for(
i = 0; pCurrentAdapter; ++
i)
643 if (pCurrentAdapter->IfType != 24 && pCurrentAdapter->IfType != 131)
645 PIP_ADAPTER_UNICAST_ADDRESS pAddress;
647 PrintRow(0,
FALSE,
L"[%02u]: %s",
i + 1, pCurrentAdapter->Description);
649 if (!(pCurrentAdapter->Flags & 0x0004))
666 pAddress = pCurrentAdapter->FirstUnicastAddress;
667 for (
j = 0; pAddress; ++
j)
672 pAddress = pAddress->Next;
676 pCurrentAdapter = pCurrentAdapter->Next;
int strcmp(const char *String1, const char *String2)
OSVERSIONINFOW VersionInfo
#define RegCloseKey(hKey)
BOOL WINAPI GetComputerNameW(LPWSTR lpBuffer, LPDWORD lpnSize)
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
static PFGETTICKCOUNT64 pGetTickCount64
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
LONG WINAPI RegEnumKeyExW(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPWSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpReserved, _Out_opt_ LPWSTR lpClass, _Inout_opt_ LPDWORD lpcbClass, _Out_opt_ PFILETIME lpftLastWriteTime)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
#define GetProcAddress(x, y)
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
BOOL WINAPI QueryPerformanceFrequency(OUT PLARGE_INTEGER lpFrequency)
BOOL WINAPI QueryPerformanceCounter(OUT PLARGE_INTEGER lpPerformanceCount)
VOID WINAPI GetSystemInfo(IN LPSYSTEM_INFO lpSystemInfo)
BOOL WINAPI GetVersionExW(IN LPOSVERSIONINFOW lpVersionInformation)
INT WINAPI GetPrivateProfileStringW(LPCWSTR section, LPCWSTR entry, LPCWSTR def_val, LPWSTR buffer, UINT len, LPCWSTR filename)
DWORD WINAPI GetTimeZoneInformation(LPTIME_ZONE_INFORMATION lpTimeZoneInformation)
INT WINAPI GetLocaleInfoW(LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len)
NET_API_STATUS WINAPI NetApiBufferFree(LPVOID Buffer)
HRESULT WINAPI SHLoadIndirectString(LPCWSTR src, LPWSTR dst, UINT dst_len, void **reserved)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
INT WINAPI WSAStartup(IN WORD wVersionRequested, OUT LPWSADATA lpWSAData)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
VOID NTAPI GlobalMemoryStatus(LPMEMORYSTATUS lpBuffer)
_Must_inspect_result_ _In_ USAGE _In_ USHORT _In_ USAGE Usage
_Check_return_opt_ _CRTIMP int __cdecl vwprintf(_In_z_ _Printf_format_string_ const wchar_t *_Format, va_list _ArgList)
_CRTIMP wchar_t *__cdecl _itow(_In_ int _Value, _Pre_notnull_ _Post_z_ wchar_t *_Dest, _In_ int _Radix)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
static PIP_ADAPTER_ADDRESSES
enum _NETSETUP_JOIN_STATUS NETSETUP_JOIN_STATUS
#define IDS_VIRT_MEM_INUSE
#define IDS_SYS_MANUFACTURER
#define IDS_CONNECTION_NAME
#define IDS_PROCESSORS_FORMAT
#define IDS_UP_TIME_FORMAT
#define IDS_NETWORK_CARDS
#define IDS_TOTAL_PHYS_MEM
#define IDS_AVAIL_PHISICAL_MEM
#define IDS_MEDIA_DISCONNECTED
#define IDS_OS_BUILD_TYPE
#define IDS_VIRT_MEM_AVAIL
#define IDS_NETWORK_CARDS_FORMAT
static BOOL RegGetDWORD(HKEY hKey, LPCWSTR lpSubKey, LPCWSTR lpValueName, LPDWORD lpData)
static VOID FormatDateTime(time_t Time, LPWSTR lpBuf)
static VOID PrintRow(UINT nTitleID, BOOL bIndent, LPWSTR lpFormat,...)
static unsigned RegGetSZ(HKEY hKey, LPCWSTR lpSubKey, LPCWSTR lpValueName, LPWSTR lpBuf, DWORD cchBuf)
static VOID FormatBytes(LPWSTR lpBuf, unsigned cBytes)
ULONGLONG GetSecondsQPC(VOID)
ULONGLONG GetSeconds(VOID)
static PLARGE_INTEGER Time
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int cChars
#define PROCESSOR_ARCHITECTURE_IA64
#define PROCESSOR_ARCHITECTURE_AMD64
#define PROCESSOR_ARCHITECTURE_INTEL
#define KEY_ENUMERATE_SUB_KEYS
#define LOCALE_SYSTEM_DEFAULT
INT WSAAPI WSAAddressToStringW(IN LPSOCKADDR lpsaAddress, IN DWORD dwAddressLength, IN LPWSAPROTOCOL_INFOW lpProtocolInfo, OUT LPWSTR lpszAddressString, IN OUT LPDWORD lpdwAddressStringLength)
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_CRTIMP struct tm *__cdecl localtime(const time_t *_Time)
ULONG dwOSVersionInfoSize
DWORD dwNumberOfProcessors
WORD wProcessorArchitecture
static LARGE_INTEGER Frequency
static LARGE_INTEGER Counter
SIZE_T GetSMBiosStringW(_In_ PCSTR DmiString, _Out_ PWSTR pBuf, _In_ DWORD cchBuf, _In_ BOOL bTrim)
PVOID LoadSMBiosData(_Inout_updates_(ID_STRINGS_MAX) PCHAR *Strings)
VOID FreeSMBiosData(_In_ PVOID Buffer)
DWORD WINAPI GetLastError(void)
#define ERROR_BUFFER_OVERFLOW
#define HKEY_LOCAL_MACHINE
#define HKEY_CURRENT_USER
#define HKEY_CLASSES_ROOT
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
NET_API_STATUS WINAPI NetGetJoinInformation(_In_ LPCWSTR lpServer, _Out_ LPWSTR *lpNameBuffer, _Out_ PNETSETUP_JOIN_STATUS BufferType)