ReactOS 0.4.16-dev-1946-g52006dd
precomp.h File Reference
#include <stdarg.h>
#include <windef.h>
#include <winbase.h>
#include <winreg.h>
#include <wingdi.h>
#include <winnls.h>
#include <winuser.h>
#include <setupapi.h>
#include <ddraw.h>
#include <initguid.h>
#include <devguid.h>
#include <strsafe.h>
#include <udmihelp.h>
#include "resource.h"
Include dependency graph for precomp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  DXDIAG_DISPLAY
 
struct  DXDIAG_CONTEXT
 

Macros

#define DIRECTINPUT_VERSION   0x0800
 
#define DIRECTSOUND_VERSION   0x0800
 
#define D3D_OVERLOADS
 
#define WIN32_NO_STATUS
 
#define _INC_WINDOWS
 
#define COM_NO_WINDOWS_H
 

Typedefs

typedef struct DXDIAG_DISPLAYPDXDIAG_DISPLAY
 
typedef struct DXDIAG_CONTEXTPDXDIAG_CONTEXT
 

Functions

BOOL EnableDialogTheme (HWND hwnd)
 
INT_PTR CALLBACK SystemPageWndProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK DisplayPageWndProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK SoundPageWndProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK MusicPageWndProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK InputPageWndProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK NetworkPageWndProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK HelpPageWndProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 
VOID DDTests (GUID *lpDevice)
 
VOID D3DTests (GUID *lpDevice)
 
void InitializeDirectSoundPage (PDXDIAG_CONTEXT pContext)
 
void InitializeDisplayAdapters (PDXDIAG_CONTEXT pContext)
 
BOOL GetFileVersion (LPCWSTR szAppName, WCHAR *szVer, DWORD szVerSize)
 
BOOL GetFileModifyTime (LPCWSTR pFullPath, WCHAR *szTime, int szTimeSize)
 
BOOL GetCatFileFromDriverPath (LPWSTR szFileName, LPWSTR szCatFileName)
 
BOOL GetRegValue (HKEY hBaseKey, LPWSTR SubKey, LPWSTR ValueName, DWORD Type, LPWSTR Result, DWORD Size)
 
VOID InsertTabCtrlItem (HWND hDlgCtrl, INT Position, LPWSTR uId)
 
VOID EnumerateDrivers (PVOID Context, HDEVINFO hList, PSP_DEVINFO_DATA pInfoData)
 

Variables

HINSTANCE hInst
 

Macro Definition Documentation

◆ _INC_WINDOWS

#define _INC_WINDOWS

Definition at line 11 of file precomp.h.

◆ COM_NO_WINDOWS_H

#define COM_NO_WINDOWS_H

Definition at line 12 of file precomp.h.

◆ D3D_OVERLOADS

#define D3D_OVERLOADS

Definition at line 6 of file precomp.h.

◆ DIRECTINPUT_VERSION

#define DIRECTINPUT_VERSION   0x0800

Definition at line 4 of file precomp.h.

◆ DIRECTSOUND_VERSION

#define DIRECTSOUND_VERSION   0x0800

Definition at line 5 of file precomp.h.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 10 of file precomp.h.

Typedef Documentation

◆ PDXDIAG_CONTEXT

◆ PDXDIAG_DISPLAY

Function Documentation

◆ D3DTests()

VOID D3DTests ( GUID lpDevice)

Definition at line 73 of file d3dtest.c.

74{
75 WNDCLASSEX winClass;
76 HWND hWnd;
79 WCHAR szCaption[256];
80
81 winClass.cbSize = sizeof(WNDCLASSEX);
83 winClass.lpfnWndProc = WindowProc;
84 winClass.cbClsExtra = 0;
85 winClass.cbWndExtra = 0;
86 winClass.hInstance = hInstance;
87 winClass.hIcon = 0;
88 winClass.hCursor = 0;
89 winClass.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
90 winClass.lpszMenuName = NULL;
91 winClass.lpszClassName = L"d3dtest";
93
94 if (!RegisterClassEx(&winClass))
95 return;
96
98 0,
99 winClass.lpszClassName,
100 NULL,
101 WS_POPUP,
104 WIDTH,
105 HEIGHT,
106 NULL,
107 NULL,
108 hInstance,
109 NULL);
110
111 if (!hWnd)
112 goto cleanup;
113
115 LoadStringW(hInstance, IDS_MAIN_DIALOG, szCaption, sizeof(szCaption) / sizeof(WCHAR));
117 goto cleanup;
118
119 StartD3DTest(lpDevice, hWnd, hInstance, szCaption, 7);
120 StartD3DTest(lpDevice, hWnd, hInstance, szCaption, 8);
121 StartD3DTest(lpDevice, hWnd, hInstance, szCaption, 9);
122
123cleanup:
126}
HWND hWnd
Definition: settings.c:17
#define IDS_D3DTEST_DESCRIPTION
Definition: resource.h:153
#define IDS_MAIN_DIALOG
Definition: resource.h:103
HINSTANCE hInstance
Definition: charmap.c:19
#define WIDTH
Definition: d3dtest.c:13
static LRESULT CALLBACK WindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: d3dtest.c:68
BOOL StartD3DTest(GUID *lpDevice, HWND hWnd, HINSTANCE hInstance, WCHAR *pszCaption, INT TestNr)
Definition: d3dtest.c:20
#define HEIGHT
Definition: d3dtest.c:14
#define NULL
Definition: types.h:112
static const WCHAR szDescription[]
Definition: provider.c:55
static void cleanup(void)
Definition: main.c:1335
INT WINAPI DECLSPEC_HOTPATCH LoadStringW(HINSTANCE instance, UINT resource_id, LPWSTR buffer, INT buflen)
Definition: string.c:1220
#define L(x)
Definition: resources.c:13
#define WS_POPUP
Definition: pedump.c:616
int cbClsExtra
Definition: winuser.h:3306
HINSTANCE hInstance
Definition: winuser.h:3308
HCURSOR hCursor
Definition: winuser.h:3310
LPCSTR lpszMenuName
Definition: winuser.h:3312
HICON hIconSm
Definition: winuser.h:3314
UINT style
Definition: winuser.h:3304
int cbWndExtra
Definition: winuser.h:3307
UINT cbSize
Definition: winuser.h:3303
WNDPROC lpfnWndProc
Definition: winuser.h:3305
LPCSTR lpszClassName
Definition: winuser.h:3313
HICON hIcon
Definition: winuser.h:3309
HBRUSH hbrBackground
Definition: winuser.h:3311
#define GetModuleHandle
Definition: winbase.h:3576
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define BLACK_BRUSH
Definition: wingdi.h:896
#define CS_VREDRAW
Definition: winuser.h:666
#define CreateWindowEx
Definition: winuser.h:5866
#define SM_CYSCREEN
Definition: winuser.h:971
#define CS_HREDRAW
Definition: winuser.h:661
#define UnregisterClass
Definition: winuser.h:5972
#define CS_DBLCLKS
Definition: winuser.h:659
#define MB_YESNO
Definition: winuser.h:828
#define IDI_APPLICATION
Definition: winuser.h:712
#define RegisterClassEx
Definition: winuser.h:5948
#define IDNO
Definition: winuser.h:847
#define LoadIcon
Definition: winuser.h:5924
WNDCLASSEXA WNDCLASSEX
Definition: winuser.h:5830
#define MB_ICONQUESTION
Definition: winuser.h:800
#define MessageBox
Definition: winuser.h:5933
#define CS_OWNDC
Definition: winuser.h:663
#define SM_CXSCREEN
Definition: winuser.h:970
BOOL WINAPI DestroyWindow(_In_ HWND)
int WINAPI GetSystemMetrics(_In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by DisplayPageWndProc().

◆ DDTests()

VOID DDTests ( GUID lpDevice)

Definition at line 70 of file ddtest.c.

71{
72 WNDCLASSEX winClass;
73 HWND hWnd;
76 WCHAR szCaption[256];
77
78 winClass.cbSize = sizeof(WNDCLASSEX);
80 winClass.lpfnWndProc = DefWindowProc;
81 winClass.cbClsExtra = 0;
82 winClass.cbWndExtra = 0;
83 winClass.hInstance = hInstance;
84 winClass.hIcon = 0;
85 winClass.hCursor = 0;
86 winClass.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
87 winClass.lpszMenuName = NULL;
88 winClass.lpszClassName = L"ddtest";
90
91 if (!RegisterClassEx(&winClass))
92 return;
93
98
99 if (!hWnd){
100 return;
101 }
102
104 LoadStringW(hInstance, IDS_MAIN_DIALOG, szCaption, sizeof(szCaption) / sizeof(WCHAR));
106 return;
107
111
114}
#define IDS_DDPRIMARY_DESCRIPTION
Definition: resource.h:143
#define IDS_DDTEST_DESCRIPTION
Definition: resource.h:142
#define IDS_DDFULLSCREEN_DESCRIPTION
Definition: resource.h:147
#define IDS_DDOFFSCREEN_RESULT
Definition: resource.h:146
#define IDS_DDOFFSCREEN_DESCRIPTION
Definition: resource.h:145
#define IDS_DDPRIMARY_RESULT
Definition: resource.h:144
#define IDS_DDFULLSCREEN_RESULT
Definition: resource.h:148
BOOL StartDDTest(GUID *lpDevice, HWND hWnd, HINSTANCE hInstance, INT resTestDescription, INT resResult, INT TestNr)
Definition: ddtest.c:24
#define DD_TEST_HEIGHT
Definition: ddtest.c:18
#define DD_TEST_WIDTH
Definition: ddtest.c:17
#define DefWindowProc
Definition: ros2win.h:31

Referenced by DisplayPageWndProc().

◆ DisplayPageWndProc()

INT_PTR CALLBACK DisplayPageWndProc ( HWND  hDlg,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 395 of file display.c.

396{
397 RECT rect;
398 HWND hMainDialog;
400 switch (message)
401 {
402 case WM_INITDIALOG:
403 {
404 pDisplay = (PDXDIAG_DISPLAY) lParam;
405 SetWindowLongPtr(hDlg, DWLP_USER, (LONG_PTR)pDisplay);
407 return TRUE;
408 }
409 case WM_COMMAND:
410 {
411 switch(LOWORD(wParam))
412 {
415 hMainDialog = GetWindow(hDlg, GW_OWNER);
416 GetWindowRect(hMainDialog, &rect);
417 /* FIXME log result errors */
419 DDTests(&pDisplay->guid);
420 else if (IDC_BUTTON_TEST3D == LOWORD(wParam))
421 D3DTests(&pDisplay->guid);
422 SetWindowPos(hMainDialog, NULL, rect.left, rect.top, rect.right, rect.bottom, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOSIZE | SWP_NOZORDER);
423 break;
424 }
425 break;
426 }
427 }
428
429 return FALSE;
430}
struct DXDIAG_DISPLAY * PDXDIAG_DISPLAY
#define IDC_BUTTON_TEST3D
Definition: resource.h:55
#define IDC_BUTTON_TESTDD
Definition: resource.h:54
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
VOID D3DTests(GUID *lpDevice)
Definition: d3dtest.c:73
VOID DDTests(GUID *lpDevice)
Definition: ddtest.c:70
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define LOWORD(l)
Definition: pedump.c:82
& rect
Definition: startmenu.cpp:1413
Definition: tftpd.h:60
Definition: windef.h:99
#define GetWindowLongPtr
Definition: treelist.c:73
#define SetWindowLongPtr
Definition: treelist.c:70
#define GW_OWNER
Definition: winuser.h:777
#define SWP_NOACTIVATE
Definition: winuser.h:1253
#define DWLP_USER
Definition: winuser.h:883
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define WM_COMMAND
Definition: winuser.h:1768
#define SWP_NOSIZE
Definition: winuser.h:1256
#define WM_INITDIALOG
Definition: winuser.h:1767
HWND WINAPI GetWindow(_In_ HWND, _In_ UINT)
#define SWP_NOOWNERZORDER
Definition: winuser.h:1260
#define SWP_NOZORDER
Definition: winuser.h:1258

Referenced by DDEnumerateCallback().

◆ EnableDialogTheme()

BOOL EnableDialogTheme ( HWND  hwnd)

Definition at line 38 of file dxdiag.c.

39{
40 HMODULE hUXTheme;
42
43 hUXTheme = LoadLibraryA("uxtheme.dll");
44
45 if(hUXTheme)
46 {
48 (ETDTProc)GetProcAddress(hUXTheme, "EnableThemeDialogTexture");
49
51 {
53
54 FreeLibrary(hUXTheme);
55 return TRUE;
56 }
57 else
58 {
59 // Failed to locate API!
60 FreeLibrary(hUXTheme);
61 return FALSE;
62 }
63 }
64 else
65 {
66 // Not running under XP? Just fail gracefully
67 return FALSE;
68 }
69}
#define GetProcAddress(x, y)
Definition: compat.h:753
#define FreeLibrary(x)
Definition: compat.h:748
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
HRESULT(WINAPI * ETDTProc)(HWND, DWORD)
Definition: dxdiag.c:33
#define ETDT_ENABLETAB
Definition: dxdiag.c:30
static ETDTProc fnEnableThemeDialogTexture
Definition: uxthemesupp.c:15
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023

Referenced by DDEnumerateCallback(), DSEnumCallback(), InitializeTabCtrl(), and OnCreate().

◆ EnumerateDrivers()

VOID EnumerateDrivers ( PVOID  Context,
HDEVINFO  hList,
PSP_DEVINFO_DATA  pInfoData 
)

Definition at line 99 of file display.c.

100{
101 HSPFILEQ hQueue;
103 SP_DRVINFO_DATA DriverInfoData;
105
108 return;
109
110 DeviceInstallParams.FlagsEx |= (DI_FLAGSEX_INSTALLEDDRIVER | DI_FLAGSEX_ALLOWEXCLUDEDDRVS);
112 return;
113
115 return;
116
117 DriverInfoData.cbSize = sizeof(DriverInfoData);
118 if (!SetupDiEnumDriverInfoW(hList, pInfoData, SPDIT_CLASSDRIVER, 0, &DriverInfoData))
119 return;
120
121 DriverInfoData.cbSize = sizeof(DriverInfoData);
122 if (!SetupDiSetSelectedDriverW(hList, pInfoData, &DriverInfoData))
123 return;
124
125 hQueue = SetupOpenFileQueue();
126 if (hQueue == (HSPFILEQ)INVALID_HANDLE_VALUE)
127 return;
128
131 {
132 SetupCloseFileQueue(hQueue);
133 return;
134 }
135
136 DeviceInstallParams.FileQueue = hQueue;
138
140 {
141 SetupCloseFileQueue(hQueue);
142 return;
143 }
144
146 {
147 SetupCloseFileQueue(hQueue);
148 return;
149 }
150
151
152 /* enumerate the driver files */
154 SetupCloseFileQueue(hQueue);
155}
static UINT WINAPI DriverFilesCallback(IN PVOID Context, IN UINT Notification, IN UINT_PTR Param1, IN UINT_PTR Param2)
Definition: display.c:47
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
BOOL WINAPI SetupDiSetDeviceInstallParamsW(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, IN PSP_DEVINSTALL_PARAMS_W DeviceInstallParams)
Definition: devinst.c:4558
BOOL WINAPI SetupDiGetDeviceInstallParamsW(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, OUT PSP_DEVINSTALL_PARAMS_W DeviceInstallParams)
Definition: devinst.c:4451
BOOL WINAPI SetupDiCallClassInstaller(DI_FUNCTION InstallFunction, HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData)
Definition: devinst.c:4024
BOOL WINAPI SetupDiSetSelectedDriverW(IN HDEVINFO DeviceInfoSet, IN OUT PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, IN OUT PSP_DRVINFO_DATA_W DriverInfoData OPTIONAL)
Definition: driver.c:1590
BOOL WINAPI SetupDiBuildDriverInfoList(IN HDEVINFO DeviceInfoSet, IN OUT PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, IN DWORD DriverType)
Definition: driver.c:718
BOOL WINAPI SetupDiEnumDriverInfoW(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, IN DWORD DriverType, IN DWORD MemberIndex, OUT PSP_DRVINFO_DATA_W DriverInfoData)
Definition: driver.c:1355
BOOL WINAPI SetupScanFileQueueW(HSPFILEQ handle, DWORD flags, HWND window, PSP_FILE_CALLBACK_W handler, PVOID context, PDWORD result)
Definition: queue.c:1510
unsigned long DWORD
Definition: ntddk_ex.h:95
HWND hList
Definition: livecd.c:10
#define SetupOpenFileQueue
Definition: fileqsup.c:29
#define SetupCloseFileQueue
Definition: fileqsup.c:30
#define SPQ_SCAN_USE_CALLBACK
Definition: setupapi.h:620
#define DI_NOVCP
Definition: setupapi.h:49
#define SPDIT_CLASSDRIVER
Definition: setupapi.h:506
#define DIF_INSTALLDEVICEFILES
Definition: setupapi.h:141
#define SetupDiSetDeviceInstallParams
Definition: setupapi.h:2620
#define DI_FLAGSEX_ALLOWEXCLUDEDDRVS
Definition: setupapi.h:87
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:409

Referenced by DisplayPageSetDeviceDetails(), and SetDeviceDetails().

◆ GetCatFileFromDriverPath()

BOOL GetCatFileFromDriverPath ( LPWSTR  szFileName,
LPWSTR  szCatFileName 
)

◆ GetFileModifyTime()

BOOL GetFileModifyTime ( LPCWSTR  pFullPath,
WCHAR szTime,
int  szTimeSize 
)

Definition at line 15 of file display.c.

16{
18 FILETIME AccessTime;
19 SYSTEMTIME SysTime, LocalTime;
21
22 hFile = CreateFileW(pFullPath, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL);
23 if (!hFile)
24 return FALSE;
25
26 if (!GetFileTime(hFile, NULL, NULL, &AccessTime))
27 {
29 return FALSE;
30 }
32
33 if (!FileTimeToSystemTime(&AccessTime, &SysTime))
34 return FALSE;
35
36 if (!SystemTimeToTzSpecificLocalTime(NULL, &SysTime, &LocalTime))
37 return FALSE;
38
40 szTime[Length-1] = L' ';
42}
#define CloseHandle
Definition: compat.h:739
#define OPEN_EXISTING
Definition: compat.h:775
#define GENERIC_READ
Definition: compat.h:135
#define CreateFileW
Definition: compat.h:741
BOOL WINAPI GetFileTime(IN HANDLE hFile, OUT LPFILETIME lpCreationTime OPTIONAL, OUT LPFILETIME lpLastAccessTime OPTIONAL, OUT LPFILETIME lpLastWriteTime OPTIONAL)
Definition: fileinfo.c:896
BOOL WINAPI FileTimeToSystemTime(IN CONST FILETIME *lpFileTime, OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:188
BOOL WINAPI SystemTimeToTzSpecificLocalTime(CONST TIME_ZONE_INFORMATION *lpTimeZoneInformation, CONST SYSTEMTIME *lpUniversalTime, LPSYSTEMTIME lpLocalTime)
Definition: timezone.c:377
INT WINAPI GetTimeFormatW(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCWSTR lpFormat, LPWSTR lpTimeStr, INT cchOut)
Definition: lcformat.c:1089
INT WINAPI GetDateFormatW(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCWSTR lpFormat, LPWSTR lpDateStr, INT cchOut)
Definition: lcformat.c:989
_In_ HANDLE hFile
Definition: mswsock.h:90
unsigned int UINT
Definition: ndis.h:50
#define LOCALE_USER_DEFAULT
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
TCHAR szTime[64]
Definition: solitaire.cpp:20
#define TIME_FORCE24HOURFORMAT
Definition: winnls.h:298
#define DATE_SHORTDATE
Definition: winnls.h:209

Referenced by DriverFilesCallback().

◆ GetFileVersion()

BOOL GetFileVersion ( LPCWSTR  szAppName,
WCHAR szVer,
DWORD  szVerSize 
)

Definition at line 105 of file network.c.

106{
107 UINT VerSize;
108 DWORD DummyHandle;
109 LPVOID pBuf;
110 WORD lang = 0;
111 WORD code = 0;
112 LPLANGANDCODEPAGE lplangcode;
113 WCHAR szBuffer[100];
114 WCHAR * pResult;
115 BOOL bResult = FALSE;
116 BOOL bVer;
117
118 static const WCHAR wFormat[] = L"\\StringFileInfo\\%04x%04x\\FileVersion";
119 static const WCHAR wTranslation[] = L"VarFileInfo\\Translation";
120
121 /* query version info size */
122 VerSize = GetFileVersionInfoSizeW(szAppName, &DummyHandle);
123 if (!VerSize)
124 return FALSE;
125
126
127 /* allocate buffer */
128 pBuf = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, VerSize);
129 if (!pBuf)
130 return FALSE;
131
132
133 /* query version info */
134 if(!GetFileVersionInfoW(szAppName, 0, VerSize, pBuf))
135 {
136 HeapFree(GetProcessHeap(), 0, pBuf);
137 return FALSE;
138 }
139
140 /* query lang code */
141 if(VerQueryValueW(pBuf, wTranslation, (LPVOID *)&lplangcode, &VerSize))
142 {
143 /* FIXME find language from current locale / if not available,
144 * default to english
145 * for now default to first available language
146 */
147 lang = lplangcode->lang;
148 code = lplangcode->code;
149 }
150 /* set up format */
151 wsprintfW(szBuffer, wFormat, lang, code);
152 /* query manufacturer */
153 pResult = NULL;
154 bVer = VerQueryValueW(pBuf, szBuffer, (LPVOID *)&pResult, &VerSize);
155
156 if (VerSize < szVerSize && bVer && pResult)
157 {
158 wcscpy(szVer, pResult);
159 pResult = wcschr(szVer, L' ');
160 if (pResult)
161 {
162 /* cut off build info */
163 VerSize = (pResult - szVer);
164 }
165 if (GetLocaleInfoW(MAKELCID(lang, SORT_DEFAULT), LOCALE_SLANGUAGE, &szVer[VerSize], szVerSize-VerSize))
166 {
167 szVer[VerSize-1] = L' ';
168 szVer[szVerSize-1] = L'\0';
169 }
170 bResult = TRUE;
171 }
172
173 HeapFree(GetProcessHeap(), 0, pBuf);
174 return bResult;
175}
wcscpy
#define wcschr
Definition: compat.h:17
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
INT WINAPI GetLocaleInfoW(LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len)
Definition: locale.c:1675
BOOL WINAPI GetFileVersionInfoW(LPCWSTR filename, DWORD handle, DWORD datasize, LPVOID data)
Definition: version.c:967
BOOL WINAPI VerQueryValueW(LPCVOID pBlock, LPCWSTR lpSubBlock, LPVOID *lplpBuffer, PUINT puLen)
Definition: version.c:1171
DWORD WINAPI GetFileVersionInfoSizeW(LPCWSTR filename, LPDWORD handle)
Definition: version.c:738
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned int BOOL
Definition: ntddk_ex.h:94
#define SORT_DEFAULT
#define MAKELCID(lgid, srtid)
TCHAR szAppName[128]
Definition: solitaire.cpp:18
Definition: inflate.c:139
static const WCHAR lang[]
Definition: wbemdisp.c:287
#define LOCALE_SLANGUAGE
Definition: winnls.h:31
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)

Referenced by DriverFilesCallback(), and EnumerateServiceProviders().

◆ GetRegValue()

BOOL GetRegValue ( HKEY  hBaseKey,
LPWSTR  SubKey,
LPWSTR  ValueName,
DWORD  Type,
LPWSTR  Result,
DWORD  Size 
)

Definition at line 15 of file system.c.

16{
17 HKEY hKey;
18 LONG res;
19 DWORD dwType;
21
22 if (RegOpenKeyExW(hBaseKey, SubKey, 0, KEY_QUERY_VALUE, &hKey) != ERROR_SUCCESS)
23 return FALSE;
24
25 dwSize = Size;
28
29 if (res != ERROR_SUCCESS)
30 return FALSE;
31
32 if (dwType != Type)
33 return FALSE;
34
35 if (Size == sizeof(DWORD))
36 return TRUE;
37
38 Result[(Size / sizeof(WCHAR))-1] = L'\0';
39 return TRUE;
40}
Type
Definition: Type.h:7
#define RegCloseKey(hKey)
Definition: registry.h:49
#define ERROR_SUCCESS
Definition: deptool.c:10
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
FxAutoRegKey hKey
GLuint res
Definition: glext.h:9613
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
#define KEY_QUERY_VALUE
Definition: nt_native.h:1019
long LONG
Definition: pedump.c:60
unsigned char * LPBYTE
Definition: typedefs.h:53
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4539
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
Definition: wdfregistry.h:243

Referenced by EnumerateServiceProviders(), GetBIOSValue(), GetDirectXVersion(), InitializeDialog(), and InitializeSystemPage().

◆ HelpPageWndProc()

INT_PTR CALLBACK HelpPageWndProc ( HWND  hDlg,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 13 of file help.c.

14{
17 switch (message) {
18 case WM_INITDIALOG:
19 {
21 return TRUE;
22 }
23 case WM_COMMAND:
24 {
25 switch (LOWORD(wParam)) {
27 break;
29 break;
30 }
31 break;
32 }
33 }
34
35 return FALSE;
36}
#define IDC_BUTTON_SYSINFO
Definition: resource.h:99
#define IDC_BUTTON_DDRAW_REFRESH
Definition: resource.h:100
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:329

Referenced by InitializeTabCtrl().

◆ InitializeDirectSoundPage()

void InitializeDirectSoundPage ( PDXDIAG_CONTEXT  pContext)

Definition at line 265 of file sound.c.

266{
267 HRESULT hResult;
268
269
270 /* create DSound object */
271
272// if (hResult != DS_OK)
273// return;
274 hResult = DirectSoundEnumerateW(DSEnumCallback, pContext);
275
276 /* release the DSound object */
277// pObj->lpVtbl->Release(pObj);
278 (void)hResult;
279}
BOOL CALLBACK DSEnumCallback(LPGUID lpGuid, LPCWSTR lpcstrDescription, LPCWSTR lpcstrModule, LPVOID lpContext)
Definition: sound.c:191
HRESULT WINAPI DirectSoundEnumerateW(LPDSENUMCALLBACKW lpDSEnumCallback, LPVOID lpContext)
Definition: enum.c:210

Referenced by InitializeTabCtrl().

◆ InitializeDisplayAdapters()

void InitializeDisplayAdapters ( PDXDIAG_CONTEXT  pContext)

Definition at line 388 of file display.c.

389{
391}
static BOOL WINAPI DDEnumerateCallback(IN GUID *lpGuid, IN LPSTR lpDriverName, IN LPSTR lpDriverDescription, IN LPVOID lpContext, IN HMONITOR hMonitor)
Definition: display.c:310
HRESULT WINAPI DirectDrawEnumerateExA(LPDDENUMCALLBACKEXA lpCallback, LPVOID lpContext, DWORD dwFlags)
Definition: main.c:208
#define DDENUM_ATTACHEDSECONDARYDEVICES
Definition: ddraw.h:193

Referenced by InitializeTabCtrl().

◆ InputPageWndProc()

INT_PTR CALLBACK InputPageWndProc ( HWND  hDlg,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 207 of file input.c.

208{
211 switch (message) {
212 case WM_INITDIALOG:
213 {
216 return TRUE;
217 }
218 }
219
220 return FALSE;
221}
static void InitializeDirectInputDialog(HWND hwndDlg)
Definition: input.c:185

Referenced by InitializeTabCtrl().

◆ InsertTabCtrlItem()

VOID InsertTabCtrlItem ( HWND  hDlgCtrl,
INT  Position,
LPWSTR  uId 
)

Definition at line 102 of file dxdiag.c.

103{
104 WCHAR szName[100];
106
107 /* setup item info */
108 memset(&item, 0, sizeof(TCITEMW));
109 item.mask = TCIF_TEXT;
110
111 /* load item name */
112 if (!HIWORD(uId))
113 {
114 szName[0] = L'\0';
115 if (!LoadStringW(hInst, LOWORD(uId), szName, 100))
116 return;
117 szName[99] = L'\0';
118 item.pszText = szName;
119 }
120 else
121 {
122 item.pszText = uId;
123 }
124
125
127}
HINSTANCE hInst
Definition: dxdiag.c:13
LONG_PTR LPARAM
Definition: minwindef.h:175
static const WCHAR szName[]
Definition: powrprof.c:45
#define TCM_INSERTITEM
Definition: commctrl.h:4054
#define TCIF_TEXT
Definition: commctrl.h:3976
#define memset(x, y, z)
Definition: compat.h:39
static COORD Position
Definition: mouse.c:34
#define HIWORD(l)
Definition: typedefs.h:247
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by DDEnumerateCallback(), DSEnumCallback(), and InitializeTabCtrl().

◆ MusicPageWndProc()

INT_PTR CALLBACK MusicPageWndProc ( HWND  hDlg,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 13 of file music.c.

14{
17 switch (message) {
18 case WM_INITDIALOG:
19 {
21 return TRUE;
22 }
23 }
24
25 return FALSE;
26}

Referenced by InitializeTabCtrl().

◆ NetworkPageWndProc()

INT_PTR CALLBACK NetworkPageWndProc ( HWND  hDlg,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 342 of file network.c.

343{
346 switch (message) {
347 case WM_INITDIALOG:
348 {
351 return TRUE;
352 }
353 }
354
355 return FALSE;
356}
static void InitializeDirectPlayDialog(HWND hwndDlg)
Definition: network.c:306

Referenced by InitializeTabCtrl().

◆ SoundPageWndProc()

INT_PTR CALLBACK SoundPageWndProc ( HWND  hDlg,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 283 of file sound.c.

284{
285 switch (message)
286 {
287 case WM_INITDIALOG:
288 {
290 return TRUE;
291 }
292 case WM_COMMAND:
293 {
295 {
296 return FALSE;
297 }
298 break;
299 }
300 }
301
302 return FALSE;
303}
#define IDC_BUTTON_TESTDSOUND
Definition: resource.h:78

Referenced by DSEnumCallback().

◆ SystemPageWndProc()

INT_PTR CALLBACK SystemPageWndProc ( HWND  hDlg,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 393 of file system.c.

394{
397 switch (message)
398 {
399 case WM_INITDIALOG:
400 {
403 return TRUE;
404 }
405 }
406
407 return FALSE;
408}
static VOID InitializeSystemPage(HWND hwndDlg)
Definition: system.c:186

Referenced by CreatePropSheet(), InitializeTabCtrl(), and OnCreate().

Variable Documentation

◆ hInst

HINSTANCE hInst
extern

Definition at line 13 of file dxdiag.c.