ReactOS 0.4.16-dev-257-g6aa11ac
display.c File Reference
#include "precomp.h"
#include <d3d9.h>
Include dependency graph for display.c:

Go to the source code of this file.

Functions

BOOL GetFileModifyTime (LPCWSTR pFullPath, WCHAR *szTime, int szTimeSize)
 
static UINT WINAPI DriverFilesCallback (IN PVOID Context, IN UINT Notification, IN UINT_PTR Param1, IN UINT_PTR Param2)
 
VOID EnumerateDrivers (PVOID Context, HDEVINFO hList, PSP_DEVINFO_DATA pInfoData)
 
static void DisplayPageSetDeviceDetails (HWND *hDlgCtrls, LPCGUID classGUID, LPGUID *deviceGUID)
 
static BOOL InitializeDialog (HWND hwndDlg, PDISPLAY_DEVICEW pDispDevice)
 
void InitializeDisplayAdapters (PDXDIAG_CONTEXT pContext)
 
INT_PTR CALLBACK DisplayPageWndProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 

Function Documentation

◆ DisplayPageSetDeviceDetails()

static void DisplayPageSetDeviceDetails ( HWND hDlgCtrls,
LPCGUID  classGUID,
LPGUID deviceGUID 
)
static

Definition at line 159 of file display.c.

160{
161 HDEVINFO hInfo;
162 DWORD dwIndex = 0;
163 SP_DEVINFO_DATA InfoData;
164 WCHAR szText[100];
165
166 /* create the setup list */
168 if (hInfo == INVALID_HANDLE_VALUE)
169 return;
170
171 do
172 {
173 ZeroMemory(&InfoData, sizeof(InfoData));
174 InfoData.cbSize = sizeof(InfoData);
175
176 if (SetupDiEnumDeviceInfo(hInfo, dwIndex, &InfoData))
177 {
178 /* set device name */
179 if (SetupDiGetDeviceRegistryPropertyW(hInfo, &InfoData, SPDRP_DEVICEDESC, NULL, (PBYTE)szText, sizeof(szText), NULL))
180 SendMessageW(hDlgCtrls[0], WM_SETTEXT, 0, (LPARAM)szText);
181
182 /* set the manufacturer name */
183 if (SetupDiGetDeviceRegistryPropertyW(hInfo, &InfoData, SPDRP_MFG, NULL, (PBYTE)szText, sizeof(szText), NULL))
184 SendMessageW(hDlgCtrls[1], WM_SETTEXT, 0, (LPARAM)szText);
185
186 /* FIXME
187 * we currently enumerate only the first adapter
188 */
189 EnumerateDrivers(&hDlgCtrls[2], hInfo, &InfoData);
190 break;
191 }
192
194 break;
195
196 dwIndex++;
197 }while(TRUE);
198
199 /* destroy the setup list */
201}
VOID EnumerateDrivers(PVOID Context, HDEVINFO hList, PSP_DEVINFO_DATA pInfoData)
Definition: display.c:99
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:105
BOOL WINAPI SetupDiEnumDeviceInfo(HDEVINFO devinfo, DWORD index, PSP_DEVINFO_DATA info)
Definition: devinst.c:1787
BOOL WINAPI SetupDiGetDeviceRegistryPropertyW(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData, DWORD Property, PDWORD PropertyRegDataType, PBYTE PropertyBuffer, DWORD PropertyBufferSize, PDWORD RequiredSize)
Definition: devinst.c:3224
HDEVINFO WINAPI SetupDiGetClassDevsW(CONST GUID *class, LPCWSTR enumstr, HWND parent, DWORD flags)
Definition: devinst.c:2292
BOOL WINAPI SetupDiDestroyDeviceInfoList(HDEVINFO devinfo)
Definition: devinst.c:2893
unsigned long DWORD
Definition: ntddk_ex.h:95
BYTE * PBYTE
Definition: pedump.c:66
#define SPDRP_DEVICEDESC
Definition: setupapi.h:507
#define DIGCF_PROFILE
Definition: setupapi.h:173
#define DIGCF_PRESENT
Definition: setupapi.h:171
#define SPDRP_MFG
Definition: setupapi.h:518
#define ZeroMemory
Definition: winbase.h:1737
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
LONG_PTR LPARAM
Definition: windef.h:208
#define WM_SETTEXT
Definition: winuser.h:1620
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by InitializeDialog().

◆ 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 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().

◆ DriverFilesCallback()

static UINT WINAPI DriverFilesCallback ( IN PVOID  Context,
IN UINT  Notification,
IN UINT_PTR  Param1,
IN UINT_PTR  Param2 
)
static

Definition at line 47 of file display.c.

51{
54 LPCWSTR pFullPath = (LPCWSTR)Param1;
55 WCHAR szVer[60];
56 LRESULT Length, fLength;
57 HWND * hDlgCtrls = (HWND *)Context;
58
59 if (wcsstr(pFullPath, L"\\DRIVERS\\"))
60 {
61 /* exclude files from drivers dir to have failsafe file version/date information */
62 return NO_ERROR;
63 }
64
65 pFile = wcsrchr(pFullPath, L'\\');
66 if (!pFile)
67 return NO_ERROR;
68
69 pFile++;
70 fLength = wcslen(pFile) + 1;
71
72 Length = SendMessageW(hDlgCtrls[0], WM_GETTEXTLENGTH, 0, 0) + 1;
73 pBuffer = HeapAlloc(GetProcessHeap(), 0, (Length + fLength) * sizeof(WCHAR));
74 if (!pBuffer)
75 return ERROR_OUTOFMEMORY;
76
78 if (Length)
79 {
80 pBuffer[Length++] = L',';
81 }
82 else
83 {
84 /* set file version */
85 if (GetFileVersion(pFullPath, szVer, sizeof(szVer)/sizeof(WCHAR)))
86 SendMessageW(hDlgCtrls[1], WM_SETTEXT, 0, (LPARAM)szVer);
87 /* set file time */
88 if (GetFileModifyTime(pFullPath, szVer, sizeof(szVer)/sizeof(WCHAR)))
89 SendMessageW(hDlgCtrls[2], WM_SETTEXT, 0, (LPARAM)szVer);
90 }
91
93 SendMessageW(hDlgCtrls[0], WM_SETTEXT, 0, (LPARAM)pBuffer);
95 return NO_ERROR;
96}
BOOL GetFileModifyTime(LPCWSTR pFullPath, WCHAR *szTime, int szTimeSize)
Definition: display.c:15
BOOL GetFileVersion(LPCWSTR szAppName, WCHAR *szVer, DWORD szVerSize)
Definition: network.c:105
#define NO_ERROR
Definition: dderror.h:5
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
#define GetProcessHeap()
Definition: compat.h:736
#define wcsrchr
Definition: compat.h:16
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
MdFileObject pFile
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
_CONST_RETURN wchar_t *__cdecl wcsstr(_In_z_ const wchar_t *_Str, _In_z_ const wchar_t *_SubStr)
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
#define L(x)
Definition: ntvdm.h:50
PVOID pBuffer
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
LONG_PTR LRESULT
Definition: windef.h:209
#define WM_GETTEXTLENGTH
Definition: winuser.h:1622
#define WM_GETTEXT
Definition: winuser.h:1621
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by EnumerateDrivers().

◆ 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
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
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().

◆ 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
TCHAR szTime[64]
Definition: solitaire.cpp:20
#define TIME_FORCE24HOURFORMAT
Definition: winnls.h:282
#define DATE_SHORTDATE
Definition: winnls.h:198

Referenced by DriverFilesCallback().

◆ InitializeDialog()

static BOOL InitializeDialog ( HWND  hwndDlg,
PDISPLAY_DEVICEW  pDispDevice 
)
static

Definition at line 206 of file display.c.

207{
208 WCHAR szText[100];
209 WCHAR szFormat[30];
210 HKEY hKey;
211 HWND hDlgCtrls[5];
212 DWORD dwMemory;
213 DEVMODEW DevMode;
214 IDirect3D9 * ppObj = NULL;
216 HRESULT hResult;
217
218 szText[0] = L'\0';
219
220 /* fix wine */
221 //ppObj = Direct3DCreate9(D3D_SDK_VERSION);
222 if (ppObj)
223 {
224 hResult = IDirect3D9_GetAdapterIdentifier(ppObj, D3DADAPTER_DEFAULT , 2/*D3DENUM_WHQL_LEVEL*/, &Identifier);
225 if (hResult == D3D_OK)
226 {
227
228 if (Identifier.WHQLLevel)
229 {
230 /* adapter is WHQL certified */
231 LoadStringW(hInst, IDS_OPTION_YES, szText, sizeof(szText)/sizeof(WCHAR));
232 }
233 else
234 {
235 LoadStringW(hInst, IDS_NOT_APPLICABLE, szText, sizeof(szText)/sizeof(WCHAR));
236 }
237 }
238 IDirect3D9_Release(ppObj);
239 }
240 else
241 {
242 LoadStringW(hInst, IDS_NOT_APPLICABLE, szText, sizeof(szText)/sizeof(WCHAR));
243 }
244 szText[(sizeof(szText)/sizeof(WCHAR))-1] = L'\0';
246
247 if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, &pDispDevice->DeviceKey[18], 0, KEY_READ, &hKey) != ERROR_SUCCESS)
248 return FALSE;
249
250 if (GetRegValue(hKey, NULL, L"HardwareInformation.ChipType", REG_BINARY, szText, sizeof(szText)))
251 {
252 /* set chip type */
254 }
255
256 if (GetRegValue(hKey, NULL, L"HardwareInformation.DacType", REG_BINARY, szText, sizeof(szText)))
257 {
258 /* set DAC type */
260 }
261
262 if (GetRegValue(hKey, NULL, L"HardwareInformation.MemorySize", REG_BINARY, (LPWSTR)&dwMemory, sizeof(dwMemory)))
263 {
264 /* set chip memory size */
265 if (dwMemory > (1048576))
266 {
267 /* buggy ATI driver requires that */
268 dwMemory /= 1048576;
269 }
270 szFormat[0] = L'\0';
271 if (LoadStringW(hInst, IDS_FORMAT_ADAPTER_MEM, szFormat, sizeof(szFormat)/sizeof(WCHAR)))
272 szFormat[(sizeof(szFormat)/sizeof(WCHAR))-1] = L'\0';
273 wsprintfW(szText, szFormat, dwMemory);
275 }
276
277 /* retrieve current display mode */
278 DevMode.dmSize = sizeof(DEVMODEW);
279 if (EnumDisplaySettingsW(pDispDevice->DeviceName, ENUM_CURRENT_SETTINGS, &DevMode))
280 {
281 szFormat[0] = L'\0';
282 if (LoadStringW(hInst, IDS_FORMAT_ADAPTER_MODE, szFormat, sizeof(szFormat)/sizeof(WCHAR)))
283 szFormat[(sizeof(szFormat)/sizeof(WCHAR))-1] = L'\0';
284 wsprintfW(szText, szFormat, DevMode.dmPelsWidth, DevMode.dmPelsHeight, DevMode.dmBitsPerPel, DevMode.dmDisplayFrequency);
286 }
287
288 /* query attached monitor */
289 wcscpy(szText, pDispDevice->DeviceName);
290 ZeroMemory(pDispDevice, sizeof(DISPLAY_DEVICEW));
291 pDispDevice->cb = sizeof(DISPLAY_DEVICEW);
292 if (EnumDisplayDevicesW(szText, 0, pDispDevice, 0))
293 {
294 /* set monitor name */
296 }
297
298 hDlgCtrls[0] = GetDlgItem(hwndDlg, IDC_STATIC_ADAPTER_ID);
299 hDlgCtrls[1] = GetDlgItem(hwndDlg, IDC_STATIC_ADAPTER_VENDOR);
300 hDlgCtrls[2] = GetDlgItem(hwndDlg, IDC_STATIC_ADAPTER_DRIVER);
301 hDlgCtrls[3] = GetDlgItem(hwndDlg, IDC_STATIC_ADAPTER_VERSION);
302 hDlgCtrls[4] = GetDlgItem(hwndDlg, IDC_STATIC_ADAPTER_DATE);
303
304 DisplayPageSetDeviceDetails(hDlgCtrls, &GUID_DEVCLASS_DISPLAY, NULL);
305 return TRUE;
306}
@ Identifier
Definition: asmpp.cpp:95
static void DisplayPageSetDeviceDetails(HWND *hDlgCtrls, LPCGUID classGUID, LPGUID *deviceGUID)
Definition: display.c:159
BOOL GetRegValue(HKEY hBaseKey, LPWSTR SubKey, LPWSTR ValueName, DWORD Type, LPWSTR Result, DWORD Size)
Definition: system.c:15
#define IDS_FORMAT_ADAPTER_MEM
Definition: resource.h:150
#define IDS_OPTION_YES
Definition: resource.h:126
#define IDC_STATIC_ADAPTER_ID
Definition: resource.h:37
#define IDC_STATIC_ADAPTER_CHIP
Definition: resource.h:39
#define IDC_STATIC_ADAPTER_MODE
Definition: resource.h:42
#define IDC_STATIC_ADAPTER_DATE
Definition: resource.h:46
#define IDS_FORMAT_ADAPTER_MODE
Definition: resource.h:151
#define IDC_STATIC_ADAPTER_MONITOR
Definition: resource.h:43
#define IDC_STATIC_ADAPTER_VERSION
Definition: resource.h:45
#define IDC_STATIC_ADAPTER_DAC
Definition: resource.h:40
#define IDS_NOT_APPLICABLE
Definition: resource.h:125
#define IDC_STATIC_ADAPTER_DRIVER
Definition: resource.h:44
#define IDC_STATIC_ADAPTER_VENDOR
Definition: resource.h:38
#define IDC_STATIC_ADAPTER_MEM
Definition: resource.h:41
#define IDC_STATIC_ADAPTER_LOGO
Definition: resource.h:47
#define IDirect3D9_GetAdapterIdentifier(p, a, b, c)
Definition: d3d9.h:224
#define IDirect3D9_Release(p)
Definition: d3d9.h:220
#define D3D_OK
Definition: d3d.h:106
#define ERROR_SUCCESS
Definition: deptool.c:10
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
HINSTANCE hInst
Definition: dxdiag.c:13
FxAutoRegKey hKey
#define REG_BINARY
Definition: nt_native.h:1496
#define KEY_READ
Definition: nt_native.h:1023
#define D3DADAPTER_DEFAULT
Definition: d3d8.h:57
WCHAR DeviceName[32]
Definition: wingdi.h:2818
WCHAR DeviceString[128]
Definition: wingdi.h:2819
WCHAR DeviceKey[128]
Definition: wingdi.h:2822
DWORD dmBitsPerPel
Definition: wingdi.h:1647
DWORD dmPelsWidth
Definition: wingdi.h:1648
DWORD dmPelsHeight
Definition: wingdi.h:1649
DWORD dmDisplayFrequency
Definition: wingdi.h:1654
WORD dmSize
Definition: wingdi.h:1620
BOOL WINAPI EnumDisplayDevicesW(LPCWSTR lpDevice, DWORD iDevNum, PDISPLAY_DEVICEW lpDisplayDevice, DWORD dwFlags)
Definition: display.c:78
BOOL WINAPI EnumDisplaySettingsW(LPCWSTR lpszDeviceName, DWORD iModeNum, LPDEVMODEW lpDevMode)
Definition: display.c:408
struct _DISPLAY_DEVICEW DISPLAY_DEVICEW
struct _devicemodeW DEVMODEW
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define ENUM_CURRENT_SETTINGS
Definition: winuser.h:179

Referenced by InitializeDisplayAdapters().

◆ 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
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
#define DISPLAY_DEVICE_MIRRORING_DRIVER
Definition: wingdi.h:1399
#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)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

Referenced by InitializeTabCtrl().