Index: ddraw/glDirectDraw.cpp |
— | — | @@ -885,6 +885,7 @@ |
886 | 886 | {
|
887 | 887 | TRACE_ENTER(5, 14, this, 9, dwFlags, 14, lpDDColorArray, 14, lplpDDPalette, 14, pUnkOuter);
|
888 | 888 | if (!this) TRACE_RET(HRESULT, 23, DDERR_INVALIDOBJECT);
|
| 889 | + if (pUnkOuter) TRACE_RET(HRESULT, 23, CLASS_E_NOAGGREGATION);
|
889 | 890 | HRESULT ret = CreatePalette2(dwFlags, lpDDColorArray, lplpDDPalette, pUnkOuter);
|
890 | 891 | if (ret == DD_OK)
|
891 | 892 | {
|
— | — | @@ -900,7 +901,8 @@ |
901 | 902 | TRACE_ENTER(5,14,this,9,dwFlags,14,lpDDColorArray,14,lplpDDPalette,14,pUnkOuter);
|
902 | 903 | if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
903 | 904 | if(!lplpDDPalette) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
|
904 | | - if(pUnkOuter) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
|
| 905 | + if(pUnkOuter) TRACE_RET(HRESULT,23,CLASS_E_NOAGGREGATION);
|
| 906 | + if (!cooplevel) TRACE_RET(HRESULT, 23, DDERR_NOCOOPERATIVELEVELSET);
|
905 | 907 | HRESULT ret = glDirectDrawPalette_Create(dwFlags, lpDDColorArray, lplpDDPalette);
|
906 | 908 | TRACE_VAR("*lplpDDPalette",14,*lplpDDPalette);
|
907 | 909 | TRACE_EXIT(23,ret);
|
— | — | @@ -1369,6 +1371,7 @@ |
1370 | 1372 | fpusetup = false;
|
1371 | 1373 | threadsafe = false;
|
1372 | 1374 | nowindowchanges = false;
|
| 1375 | + cooplevel = 0;
|
1373 | 1376 | timer = timeGetTime();
|
1374 | 1377 | ZeroMemory(&oldmode,sizeof(DEVMODE));
|
1375 | 1378 | surfaces = (glDirectDrawSurface7 **)malloc(1024*sizeof(glDirectDrawSurface7 *));
|
— | — | @@ -1494,6 +1497,7 @@ |
1495 | 1498 | internalrefresh = primaryrefresh = screenrefresh = devmode.dmDisplayFrequency;
|
1496 | 1499 | primarybpp = bpp;
|
1497 | 1500 | InitGL(x,y,bpp,fullscreen,internalrefresh,hWnd,this,devwnd);
|
| 1501 | + cooplevel = dwFlags;
|
1498 | 1502 | TRACE_EXIT(23,DD_OK);
|
1499 | 1503 | return DD_OK;
|
1500 | 1504 | }
|
— | — | @@ -2109,8 +2113,6 @@ |
2110 | 2114 | {
|
2111 | 2115 | lpDDS7->QueryInterface(IID_IDirectDrawSurface,(LPVOID*) lplpDDSurface);
|
2112 | 2116 | lpDDS7->Release();
|
2113 | | - this->AddRef();
|
2114 | | - ((glDirectDrawSurface7*)lpDDS7)->creator = this;
|
2115 | 2117 | TRACE_VAR("*lplpDDSurface",14,lplpDDSurface);
|
2116 | 2118 | TRACE_EXIT(23,DD_OK);
|
2117 | 2119 | return DD_OK;
|
— | — | @@ -2313,8 +2315,6 @@ |
2314 | 2316 | {
|
2315 | 2317 | lpDDS7->QueryInterface(IID_IDirectDrawSurface,(LPVOID*) lplpDDSurface);
|
2316 | 2318 | lpDDS7->Release();
|
2317 | | - this->AddRef();
|
2318 | | - ((glDirectDrawSurface7*)lpDDS7)->creator = this;
|
2319 | 2319 | TRACE_EXIT(23, DD_OK);
|
2320 | 2320 | return DD_OK;
|
2321 | 2321 | }
|
Index: ddraw/glDirectDraw.h |
— | — | @@ -137,6 +137,7 @@ |
138 | 138 | glDirect3D1 *glD3D1;
|
139 | 139 | DWORD timer;
|
140 | 140 | bool devwnd;
|
| 141 | + DWORD cooplevel;
|
141 | 142 | };
|
142 | 143 |
|
143 | 144 | class glDirectDraw1 : public IDirectDraw
|