Changeset 38366 in vbox
- Timestamp:
- Aug 9, 2011 6:55:53 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/vboxext.c
r38363 r38366 241 241 } 242 242 243 /* wine serializes all calls to us, so no need for any synchronization here */ 243 244 static DWORD g_cVBoxExtInits = 0; 245 246 static DWORD vboxExtAddRef() 247 { 248 return ++g_cVBoxExtInits; 249 } 250 251 static DWORD vboxExtRelease() 252 { 253 DWORD cVBoxExtInits = --g_cVBoxExtInits; 254 Assert(cVBoxExtInits < UINT32_MAX/2); 255 return cVBoxExtInits; 256 } 257 258 static DWORD vboxExtGetRef() 259 { 260 return g_cVBoxExtInits; 261 } 262 244 263 HRESULT VBoxExtCheckInit() 245 264 { 246 265 HRESULT hr = S_OK; 247 if (! g_cVBoxExtInits)266 if (!vboxExtGetRef()) 248 267 { 249 268 hr = vboxExtInit(); … … 254 273 } 255 274 } 256 ++g_cVBoxExtInits;275 vboxExtAddRef(); 257 276 return S_OK; 258 277 } … … 261 280 { 262 281 HRESULT hr = S_OK; 263 if ( g_cVBoxExtInits== 1)282 if (vboxExtGetRef() == 1) 264 283 { 265 284 hr = vboxExtTerm(); … … 270 289 } 271 290 } 272 --g_cVBoxExtInits;291 vboxExtRelease(); 273 292 return S_OK; 274 293 } … … 415 434 *phWnd = hWnd; 416 435 *phDC = GetDC(hWnd); 436 /* make sure we keep inited until the window is active */ 437 vboxExtAddRef(); 417 438 } 418 439 else … … 435 456 Assert(bResult); 436 457 if (bResult) 458 { 459 /* release the reference we previously acquired on window creation */ 460 vboxExtRelease(); 437 461 return S_OK; 462 } 438 463 439 464 winErr = GetLastError();
Note:
See TracChangeset
for help on using the changeset viewer.