Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.6 KiB

  1. #include "pch.cpp"
  2. #pragma hdrstop
  3. HRESULT D3DAPI katmai_FEContextCreate(DWORD dwFlags, LPD3DFE_PVFUNCS *lpLeafFuncs)
  4. {
  5. LPD3DFE_CONTEXTCREATE pfnFEContextCreate = NULL;
  6. HKEY hKey;
  7. LONG lRet;
  8. lRet = RegOpenKey( HKEY_LOCAL_MACHINE, RESPATH_D3D, &hKey );
  9. if ( lRet == ERROR_SUCCESS )
  10. {
  11. char filename[_MAX_PATH];
  12. DWORD dwSize = sizeof(filename);
  13. DWORD dwType;
  14. lRet = RegQueryValueEx(hKey,
  15. "GeometryDriver",
  16. NULL,
  17. &dwType,
  18. (LPBYTE) filename,
  19. &dwSize);
  20. if (lRet == ERROR_SUCCESS && dwType == REG_SZ)
  21. {
  22. HINSTANCE hGeometryDLL;
  23. hGeometryDLL = LoadLibrary(filename);
  24. if (hGeometryDLL)
  25. {
  26. pfnFEContextCreate = (LPD3DFE_CONTEXTCREATE) GetProcAddress(hGeometryDLL, "FEContextCreate");
  27. }
  28. else
  29. {
  30. D3D_ERR("LoadLibrary failed on GeometryDriver");
  31. goto _error_exit;
  32. }
  33. }
  34. else
  35. {
  36. D3D_ERR("RegQueryValue failed on GeometryDriver");
  37. goto _error_exit;
  38. }
  39. RegCloseKey( hKey );
  40. }
  41. else
  42. {
  43. D3D_ERR("RegOpenKey failed on GeometryDriver");
  44. goto _error_exit;
  45. }
  46. // here if we think we have a valid pfnFEContextCreate
  47. return(pfnFEContextCreate(dwFlags, lpLeafFuncs));
  48. _error_exit:
  49. return DDERR_GENERIC;
  50. }