ReactOS 0.4.15-dev-5669-g09dde2c
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 366 of file display.c.

367{
368 RECT rect;
370 switch (message)
371 {
372 case WM_INITDIALOG:
373 {
374 pContext = (PDXDIAG_CONTEXT) lParam;
375 SetWindowLongPtr(hDlg, DWLP_USER, (LONG_PTR)pContext);
377 return TRUE;
378 }
379 case WM_COMMAND:
380 {
381 switch(LOWORD(wParam))
382 {
385 GetWindowRect(pContext->hMainDialog, &rect);
386 /* FIXME log result errors */
388 DDTests();
389 else if (IDC_BUTTON_TEST3D == LOWORD(wParam))
390 D3DTests();
392 break;
393 }
394 break;
395 }
396 }
397
398 return FALSE;
399}
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:71
#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:1232
#define DWLP_USER
Definition: winuser.h:866
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:1730
#define SWP_NOSIZE
Definition: winuser.h:1235
#define WM_INITDIALOG
Definition: winuser.h:1729
#define SWP_NOOWNERZORDER
Definition: winuser.h:1239
#define SWP_NOZORDER
Definition: winuser.h:1237

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

104{
105 HSPFILEQ hQueue;
107 SP_DRVINFO_DATA DriverInfoData;
109
112 return;
113
114 DeviceInstallParams.FlagsEx |= (DI_FLAGSEX_INSTALLEDDRIVER | DI_FLAGSEX_ALLOWEXCLUDEDDRVS);
116 return;
117
119 return;
120
121 DriverInfoData.cbSize = sizeof(DriverInfoData);
122 if (!SetupDiEnumDriverInfoW(hList, pInfoData, SPDIT_CLASSDRIVER, 0, &DriverInfoData))
123 return;
124
125 DriverInfoData.cbSize = sizeof(DriverInfoData);
126 if (!SetupDiSetSelectedDriverW(hList, pInfoData, &DriverInfoData))
127 return;
128
129 hQueue = SetupOpenFileQueue();
130 if (hQueue == (HSPFILEQ)INVALID_HANDLE_VALUE)
131 return;
132
135 {
136 SetupCloseFileQueue(hQueue);
137 return;
138 }
139
140 DeviceInstallParams.FileQueue = hQueue;
142
144 {
145 SetupCloseFileQueue(hQueue);
146 return;
147 }
148
150 {
151 SetupCloseFileQueue(hQueue);
152 return;
153 }
154
155
156 /* enumerate the driver files */
158 SetupCloseFileQueue(hQueue);
159}
static UINT WINAPI DriverFilesCallback(IN PVOID Context, IN UINT Notification, IN UINT_PTR Param1, IN UINT_PTR Param2)
Definition: display.c:51
#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:1558
HSPFILEQ WINAPI SetupOpenFileQueue(void)
Definition: queue.c:493
unsigned long DWORD
Definition: ntddk_ex.h:95
HWND hList
Definition: livecd.c:10
#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
BOOL WINAPI SetupCloseFileQueue(IN HSPFILEQ QueueHandle)
Definition: fileqsup.c:217
_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:426

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 TIME_ZONE_INFORMATION TimeInfo;
22
23 hFile = CreateFileW(pFullPath, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL);
24 if (!hFile)
25 return FALSE;
26
27 if (!GetFileTime(hFile, NULL, NULL, &AccessTime))
28 {
30 return FALSE;
31 }
33
34 if(!GetTimeZoneInformation(&TimeInfo))
35 return FALSE;
36
37 if (!FileTimeToSystemTime(&AccessTime, &SysTime))
38 return FALSE;
39
40 if (!SystemTimeToTzSpecificLocalTime(&TimeInfo, &SysTime, &LocalTime))
41 return FALSE;
42
44 szTime[Length-1] = L' ';
46}
#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
DWORD WINAPI GetTimeZoneInformation(LPTIME_ZONE_INFORMATION lpTimeZoneInformation)
Definition: timezone.c:262
INT WINAPI GetTimeFormatW(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCWSTR lpFormat, LPWSTR lpTimeStr, INT cchOut)
Definition: lcformat.c:1079
INT WINAPI GetDateFormatW(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCWSTR lpFormat, LPWSTR lpDateStr, INT cchOut)
Definition: lcformat.c:979
_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:19
#define TIME_FORCE24HOURFORMAT
Definition: winnls.h:280
#define DATE_SHORTDATE
Definition: winnls.h:196

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
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:1049
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
INT WINAPI GetLocaleInfoW(LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len)
Definition: lang.c:1102
#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:17
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:47
#define ERROR_SUCCESS
Definition: deptool.c:10
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3356
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4121
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:317

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

313{
314 DISPLAY_DEVICEW DispDevice;
315 HWND * hDlgs;
316 HWND hwndDlg;
317 WCHAR szDisplay[20];
318 WCHAR szText[30];
319 DWORD dwOffset = 0;
320
321 while(TRUE)
322 {
323 ZeroMemory(&DispDevice, sizeof(DISPLAY_DEVICEW));
324 DispDevice.cb = sizeof(DISPLAY_DEVICEW);
325 if (!EnumDisplayDevicesW(NULL, pContext->NumDisplayAdapter + dwOffset, &DispDevice, 0))
326 return;
327
328 /* skip devices not attached to the desktop and mirror drivers */
330 {
331 dwOffset++;
332 continue;
333 }
334 if (pContext->NumDisplayAdapter)
335 hDlgs = HeapReAlloc(GetProcessHeap(), 0, pContext->hDisplayWnd, (pContext->NumDisplayAdapter + 1) * sizeof(HWND));
336 else
337 hDlgs = HeapAlloc(GetProcessHeap(), 0, (pContext->NumDisplayAdapter + 1) * sizeof(HWND));
338
339 if (!hDlgs)
340 break;
341
342 pContext->hDisplayWnd = hDlgs;
344 if (!hwndDlg)
345 break;
346
347 /* initialize the dialog */
348 InitializeDialog(hwndDlg, &DispDevice);
349
350 szDisplay[0] = L'\0';
351 LoadStringW(hInst, IDS_DISPLAY_DIALOG, szDisplay, sizeof(szDisplay)/sizeof(WCHAR));
352 szDisplay[(sizeof(szDisplay)/sizeof(WCHAR))-1] = L'\0';
353
354 wsprintfW (szText, L"%s %u", szDisplay, pContext->NumDisplayAdapter + 1);
356
357 hDlgs[pContext->NumDisplayAdapter] = hwndDlg;
358 pContext->NumDisplayAdapter++;
359 }
360
361
362}
static BOOL InitializeDialog(HWND hwndDlg, PDISPLAY_DEVICEW pDispDevice)
Definition: display.c:210
INT_PTR CALLBACK DisplayPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: display.c:366
#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:1670
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:4049
#define TCIF_TEXT
Definition: commctrl.h:3971
#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.