Skip to content

Commit 343d1d4

Browse files
committed
[DXDIAG] Add a GUID field to DXDIAG_DISPLAY, and give it to DirectDrawCreate
Currently, this GUID is always NULL.
1 parent 6f47c88 commit 343d1d4

File tree

7 files changed

+33
-32
lines changed

7 files changed

+33
-32
lines changed

base/applications/dxdiag/d3dtest.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
#define WIDTH 800
1414
#define HEIGHT 600
1515

16-
BOOL D3D7Test(HWND hWnd);
17-
BOOL D3D8Test(HWND hWnd);
18-
BOOL D3D9Test(HWND hWnd);
16+
BOOL D3D7Test(GUID *lpDevice, HWND hWnd);
17+
BOOL D3D8Test(GUID *lpDevice, HWND hWnd);
18+
BOOL D3D9Test(GUID *lpDevice, HWND hWnd);
1919

20-
BOOL StartD3DTest(HWND hWnd, HINSTANCE hInstance, WCHAR* pszCaption, INT TestNr)
20+
BOOL StartD3DTest(GUID *lpDevice, HWND hWnd, HINSTANCE hInstance, WCHAR* pszCaption, INT TestNr)
2121
{
2222
WCHAR szTestDescriptionRaw[256];
2323
WCHAR szTestDescription[256];
@@ -39,13 +39,13 @@ BOOL StartD3DTest(HWND hWnd, HINSTANCE hInstance, WCHAR* pszCaption, INT TestNr)
3939

4040
switch(TestNr){
4141
case 7:
42-
Result = D3D7Test(hWnd);
42+
Result = D3D7Test(lpDevice, hWnd);
4343
break;
4444
case 8:
45-
Result = D3D8Test(hWnd);
45+
Result = D3D8Test(lpDevice, hWnd);
4646
break;
4747
case 9:
48-
Result = D3D9Test(hWnd);
48+
Result = D3D9Test(lpDevice, hWnd);
4949
break;
5050
default:
5151
Result = FALSE;
@@ -70,7 +70,7 @@ static LRESULT CALLBACK WindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
7070
return DefWindowProc(hWnd, msg, wParam, lParam);
7171
}
7272

73-
VOID D3DTests()
73+
VOID D3DTests(GUID *lpDevice)
7474
{
7575
WNDCLASSEX winClass;
7676
HWND hWnd;
@@ -116,9 +116,9 @@ VOID D3DTests()
116116
if(MessageBox(NULL, szDescription, szCaption, MB_YESNO | MB_ICONQUESTION) == IDNO)
117117
goto cleanup;
118118

119-
StartD3DTest(hWnd, hInstance, szCaption, 7);
120-
StartD3DTest(hWnd, hInstance, szCaption, 8);
121-
StartD3DTest(hWnd, hInstance, szCaption, 9);
119+
StartD3DTest(lpDevice, hWnd, hInstance, szCaption, 7);
120+
StartD3DTest(lpDevice, hWnd, hInstance, szCaption, 8);
121+
StartD3DTest(lpDevice, hWnd, hInstance, szCaption, 9);
122122

123123
cleanup:
124124
DestroyWindow(hWnd);

base/applications/dxdiag/d3dtest7.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include "precomp.h"
1010

11-
BOOL D3D7Test(HWND hWnd)
11+
BOOL D3D7Test(GUID *lpDevice, HWND hWnd)
1212
{
1313
return FALSE;
1414
}

base/applications/dxdiag/d3dtest8.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include "precomp.h"
1010

11-
BOOL D3D8Test(HWND hWnd)
11+
BOOL D3D8Test(GUID *lpDevice, HWND hWnd)
1212
{
1313
return FALSE;
1414
}

base/applications/dxdiag/d3dtest9.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include "precomp.h"
1010

11-
BOOL D3D9Test(HWND hWnd)
11+
BOOL D3D9Test(GUID *lpDevice, HWND hWnd)
1212
{
1313
return FALSE;
1414
}

base/applications/dxdiag/ddtest.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
#include "precomp.h"
1010

11-
BOOL DDPrimarySurfaceTest(HWND hWnd);
12-
BOOL DDOffscreenBufferTest(HWND hWnd, BOOL Fullscreen);
11+
BOOL DDPrimarySurfaceTest(GUID *lpDevice, HWND hWnd);
12+
BOOL DDOffscreenBufferTest(GUID *lpDevice, HWND hWnd, BOOL Fullscreen);
1313
VOID DDRedrawFrame(LPDIRECTDRAWSURFACE lpDDSurface);
1414
VOID DDUpdateFrame(LPDIRECTDRAWSURFACE lpDDPrimarySurface ,LPDIRECTDRAWSURFACE lpDDBackBuffer, BOOL Fullscreen, INT *posX, INT *posY, INT *gainX, INT *gainY, RECT *rectDD);
1515

@@ -21,7 +21,7 @@ VOID DDUpdateFrame(LPDIRECTDRAWSURFACE lpDDPrimarySurface ,LPDIRECTDRAWSURFACE l
2121
#define DD_SQUARE_STEP 2
2222

2323

24-
BOOL StartDDTest(HWND hWnd, HINSTANCE hInstance, INT resTestDescription, INT resResult, INT TestNr)
24+
BOOL StartDDTest(GUID *lpDevice, HWND hWnd, HINSTANCE hInstance, INT resTestDescription, INT resResult, INT TestNr)
2525
{
2626
WCHAR szTestDescription[256];
2727
WCHAR szCaption[256];
@@ -41,13 +41,13 @@ BOOL StartDDTest(HWND hWnd, HINSTANCE hInstance, INT resTestDescription, INT res
4141

4242
switch(TestNr){
4343
case 1:
44-
Result = DDPrimarySurfaceTest(hWnd);
44+
Result = DDPrimarySurfaceTest(lpDevice, hWnd);
4545
break;
4646
case 2:
47-
Result = DDOffscreenBufferTest(hWnd, FALSE);
47+
Result = DDOffscreenBufferTest(lpDevice, hWnd, FALSE);
4848
break;
4949
case 3:
50-
Result = DDOffscreenBufferTest(hWnd, TRUE);
50+
Result = DDOffscreenBufferTest(lpDevice, hWnd, TRUE);
5151
break;
5252
default:
5353
Result = FALSE;
@@ -67,7 +67,7 @@ BOOL StartDDTest(HWND hWnd, HINSTANCE hInstance, INT resTestDescription, INT res
6767
return FALSE;
6868
}
6969

70-
VOID DDTests()
70+
VOID DDTests(GUID *lpDevice)
7171
{
7272
WNDCLASSEX winClass;
7373
HWND hWnd;
@@ -105,23 +105,23 @@ VOID DDTests()
105105
if(MessageBox(NULL, szDescription, szCaption, MB_YESNO | MB_ICONQUESTION) == IDNO)
106106
return;
107107

108-
StartDDTest(hWnd, hInstance, IDS_DDPRIMARY_DESCRIPTION, IDS_DDPRIMARY_RESULT, 1);
109-
StartDDTest(hWnd, hInstance, IDS_DDOFFSCREEN_DESCRIPTION, IDS_DDOFFSCREEN_RESULT, 2);
110-
StartDDTest(hWnd, hInstance, IDS_DDFULLSCREEN_DESCRIPTION, IDS_DDFULLSCREEN_RESULT, 3);
108+
StartDDTest(lpDevice, hWnd, hInstance, IDS_DDPRIMARY_DESCRIPTION, IDS_DDPRIMARY_RESULT, 1);
109+
StartDDTest(lpDevice, hWnd, hInstance, IDS_DDOFFSCREEN_DESCRIPTION, IDS_DDOFFSCREEN_RESULT, 2);
110+
StartDDTest(lpDevice, hWnd, hInstance, IDS_DDFULLSCREEN_DESCRIPTION, IDS_DDFULLSCREEN_RESULT, 3);
111111

112112
DestroyWindow(hWnd);
113113
UnregisterClass(winClass.lpszClassName, hInstance);
114114
}
115115

116-
BOOL DDPrimarySurfaceTest(HWND hWnd){
116+
BOOL DDPrimarySurfaceTest(GUID *lpDevice, HWND hWnd){
117117
UINT TimerID;
118118
MSG msg;
119119

120120
LPDIRECTDRAW lpDD = NULL;
121121
LPDIRECTDRAWSURFACE lpDDSurface = NULL;
122122
DDSURFACEDESC DDSurfaceDesc;
123123

124-
if(DirectDrawCreate(NULL, &lpDD, NULL) != DD_OK)
124+
if(DirectDrawCreate(lpDevice, &lpDD, NULL) != DD_OK)
125125
return FALSE;
126126

127127
if(lpDD->lpVtbl->SetCooperativeLevel(lpDD, hWnd, DDSCL_NORMAL) != DD_OK)
@@ -197,7 +197,7 @@ VOID DDRedrawFrame(LPDIRECTDRAWSURFACE lpDDSurface)
197197
}
198198

199199

200-
BOOL DDOffscreenBufferTest(HWND hWnd, BOOL Fullscreen){
200+
BOOL DDOffscreenBufferTest(GUID *lpDevice, HWND hWnd, BOOL Fullscreen){
201201
UINT_PTR TimerID, TimerIDUpdate;
202202
LPDIRECTDRAW lpDD;
203203
LPDIRECTDRAWSURFACE lpDDPrimarySurface;
@@ -210,7 +210,7 @@ BOOL DDOffscreenBufferTest(HWND hWnd, BOOL Fullscreen){
210210
POINT wndPoint;
211211
INT posX = 0, posY = 10, xGain = DD_SQUARE_STEP, yGain = DD_SQUARE_STEP;
212212

213-
if(DirectDrawCreate(NULL, &lpDD, NULL) != DD_OK)
213+
if(DirectDrawCreate(lpDevice, &lpDD, NULL) != DD_OK)
214214
return FALSE;
215215

216216
ZeroMemory(&DDSurfaceDesc, sizeof(DDSurfaceDesc));

base/applications/dxdiag/display.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,9 +389,9 @@ DisplayPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
389389
GetWindowRect(hMainDialog, &rect);
390390
/* FIXME log result errors */
391391
if (IDC_BUTTON_TESTDD == LOWORD(wParam))
392-
DDTests();
392+
DDTests(&pDisplay->guid);
393393
else if (IDC_BUTTON_TEST3D == LOWORD(wParam))
394-
D3DTests();
394+
D3DTests(&pDisplay->guid);
395395
SetWindowPos(hMainDialog, NULL, rect.left, rect.top, rect.right, rect.bottom, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOSIZE | SWP_NOZORDER);
396396
break;
397397
}

base/applications/dxdiag/precomp.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
typedef struct
3030
{
3131
HWND hDisplayWnd;
32+
GUID guid;
3233
} DXDIAG_DISPLAY, *PDXDIAG_DISPLAY;
3334

3435
typedef struct
@@ -58,10 +59,10 @@ INT_PTR CALLBACK NetworkPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPAR
5859
INT_PTR CALLBACK HelpPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
5960

6061
/* DirectDraw tests */
61-
VOID DDTests(VOID);
62+
VOID DDTests(GUID *lpDevice);
6263

6364
/* Direct3D tests */
64-
VOID D3DTests(VOID);
65+
VOID D3DTests(GUID *lpDevice);
6566

6667
/* DirectSound initialization */
6768
void InitializeDirectSoundPage(PDXDIAG_CONTEXT pContext);

0 commit comments

Comments
 (0)