ReactOS 0.4.16-dev-258-g81860b4
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_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_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 (VOID)
 
VOID D3DTests (VOID)
 
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

Function Documentation

◆ D3DTests()

VOID D3DTests ( VOID  )

◆ DDTests()

VOID DDTests ( VOID  )

◆ DisplayPageWndProc()

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

Definition at line 362 of file display.c.

363{
364 RECT rect;
366 switch (message)
367 {
368 case WM_INITDIALOG:
369 {
370 pContext = (PDXDIAG_CONTEXT) lParam;
371 SetWindowLongPtr(hDlg, DWLP_USER, (LONG_PTR)pContext);
373 return TRUE;
374 }
375 case WM_COMMAND:
376 {
377 switch(LOWORD(wParam))
378 {
381 GetWindowRect(pContext->hMainDialog, &rect);
382 /* FIXME log result errors */
384 DDTests();
385 else if (IDC_BUTTON_TEST3D == LOWORD(wParam))
386 D3DTests();
388 break;
389 }
390 break;
391 }
392 }
393
394 return FALSE;
395}
struct DXDIAG_CONTEXT * PDXDIAG_CONTEXT
#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()
Definition: d3dtest.c:73
VOID DDTests()
Definition: ddtest.c:70
#define NULL
Definition: types.h:112
#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
HWND hMainDialog
Definition: precomp.h:31
Definition: tftpd.h:60
#define GetWindowLongPtr
Definition: treelist.c:73
#define SetWindowLongPtr
Definition: treelist.c:70
#define SWP_NOACTIVATE
Definition: winuser.h:1245
#define DWLP_USER
Definition: winuser.h:875
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:1743
#define SWP_NOSIZE
Definition: winuser.h:1248
#define WM_INITDIALOG
Definition: winuser.h:1742
#define SWP_NOOWNERZORDER
Definition: winuser.h:1252
#define SWP_NOZORDER
Definition: winuser.h:1250

Referenced by InitializeDisplayAdapters().

◆ 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 DSEnumCallback(), InitializeDisplayAdapters(), 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:619
#define DI_NOVCP
Definition: setupapi.h:49
#define SPDIT_CLASSDRIVER
Definition: setupapi.h:505
#define DIF_INSTALLDEVICEFILES
Definition: setupapi.h:140
#define SetupDiSetDeviceInstallParams
Definition: setupapi.h:2619
#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:1093
INT WINAPI GetDateFormatW(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCWSTR lpFormat, LPWSTR lpDateStr, INT cchOut)
Definition: lcformat.c:993
_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
#define L(x)
Definition: ntvdm.h:50
TCHAR szTime[64]
Definition: solitaire.cpp:20
#define TIME_FORCE24HOURFORMAT
Definition: winnls.h:282
#define DATE_SHORTDATE
Definition: winnls.h:198

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}
#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:1666
BOOL WINAPI GetFileVersionInfoW(LPCWSTR filename, DWORD handle, DWORD datasize, LPVOID data)
Definition: version.c:845
BOOL WINAPI VerQueryValueW(LPCVOID pBlock, LPCWSTR lpSubBlock, LPVOID *lplpBuffer, PUINT puLen)
Definition: version.c:1057
DWORD WINAPI GetFileVersionInfoSizeW(LPCWSTR filename, LPDWORD handle)
Definition: version.c:611
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned short WORD
Definition: ntddk_ex.h:93
#define SORT_DEFAULT
#define MAKELCID(lgid, srtid)
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
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:26
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
__wchar_t WCHAR
Definition: xmlstorage.h:180

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:1016
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:4533
_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:325

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 308 of file display.c.

309{
310 DISPLAY_DEVICEW DispDevice;
311 HWND * hDlgs;
312 HWND hwndDlg;
313 WCHAR szDisplay[20];
314 WCHAR szText[30];
315 DWORD dwOffset = 0;
316
317 while(TRUE)
318 {
319 ZeroMemory(&DispDevice, sizeof(DISPLAY_DEVICEW));
320 DispDevice.cb = sizeof(DISPLAY_DEVICEW);
321 if (!EnumDisplayDevicesW(NULL, pContext->NumDisplayAdapter + dwOffset, &DispDevice, 0))
322 return;
323
324 /* skip devices not attached to the desktop and mirror drivers */
326 {
327 dwOffset++;
328 continue;
329 }
330 if (pContext->NumDisplayAdapter)
331 hDlgs = HeapReAlloc(GetProcessHeap(), 0, pContext->hDisplayWnd, (pContext->NumDisplayAdapter + 1) * sizeof(HWND));
332 else
333 hDlgs = HeapAlloc(GetProcessHeap(), 0, (pContext->NumDisplayAdapter + 1) * sizeof(HWND));
334
335 if (!hDlgs)
336 break;
337
338 pContext->hDisplayWnd = hDlgs;
340 if (!hwndDlg)
341 break;
342
343 /* initialize the dialog */
344 InitializeDialog(hwndDlg, &DispDevice);
345
346 szDisplay[0] = L'\0';
347 LoadStringW(hInst, IDS_DISPLAY_DIALOG, szDisplay, sizeof(szDisplay)/sizeof(WCHAR));
348 szDisplay[(sizeof(szDisplay)/sizeof(WCHAR))-1] = L'\0';
349
350 wsprintfW (szText, L"%s %u", szDisplay, pContext->NumDisplayAdapter + 1);
352
353 hDlgs[pContext->NumDisplayAdapter] = hwndDlg;
354 pContext->NumDisplayAdapter++;
355 }
356
357
358}
static BOOL InitializeDialog(HWND hwndDlg, PDISPLAY_DEVICEW pDispDevice)
Definition: display.c:206
INT_PTR CALLBACK DisplayPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: display.c:362
#define IDD_DISPLAY_DIALOG
Definition: resource.h:8
#define IDS_DISPLAY_DIALOG
Definition: resource.h:105
#define IDC_TAB_CONTROL
Definition: resource.h:16
#define HeapReAlloc
Definition: compat.h:734
HINSTANCE hInst
Definition: dxdiag.c:13
BOOL EnableDialogTheme(HWND hwnd)
Definition: dxdiag.c:38
VOID InsertTabCtrlItem(HWND hDlgCtrl, INT Position, LPWSTR uId)
Definition: dxdiag.c:102
_In_ DWORD _In_ DWORD dwOffset
Definition: ntgdi.h:2033
HWND * hDisplayWnd
Definition: precomp.h:34
ULONG NumDisplayAdapter
Definition: precomp.h:33
DWORD StateFlags
Definition: wingdi.h:2820
BOOL WINAPI EnumDisplayDevicesW(LPCWSTR lpDevice, DWORD iDevNum, PDISPLAY_DEVICEW lpDisplayDevice, DWORD dwFlags)
Definition: display.c:78
#define ZeroMemory
Definition: winbase.h:1737
LONG_PTR LPARAM
Definition: windef.h:208
#define DISPLAY_DEVICE_MIRRORING_DRIVER
Definition: wingdi.h:1399
struct _DISPLAY_DEVICEW DISPLAY_DEVICEW
#define DISPLAY_DEVICE_ATTACHED_TO_DESKTOP
Definition: wingdi.h:1396
HWND WINAPI CreateDialogParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

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}
static ATOM item
Definition: dde.c:856
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 DSEnumCallback(), InitializeDisplayAdapters(), 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.