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.

80 lines
1.8 KiB

  1. #include "unixfile.h"
  2. void UnixEnsureDir(char *pszFile)
  3. {
  4. char szDirPath[MAX_PATH];
  5. int iLen;
  6. lstrcpy(szDirPath, pszFile);
  7. iLen = lstrlen(szDirPath);
  8. while (szDirPath[iLen] != '/')
  9. {
  10. iLen--;
  11. }
  12. szDirPath[iLen] = '\0';
  13. CreateDirectory(szDirPath, NULL);
  14. }
  15. void UnixifyFileName(char* lpszName)
  16. {
  17. while(*lpszName)
  18. {
  19. if(*lpszName == '\\')
  20. *lpszName = '/';
  21. lpszName++;
  22. }
  23. }
  24. const GUID CLSID_JAVA_VM =
  25. {
  26. 0x08b0e5c0, 0x4fcb, 0x11cf, {0xaa, 0xa5, 0x00, 0x40, 0x1c, 0x60, 0x85, 0x00}
  27. };
  28. #define JAVA_DLL TEXT("msjava.dll")
  29. #define szVMInstalled TEXT("IsVMInstalled")
  30. HRESULT CheckIEFeatureOnUnix(LPCWSTR pwszIEFeature,
  31. DWORD* dwInstalledVerHi,
  32. DWORD* dwInstalledVerLo,
  33. DWORD dwFlags)
  34. {
  35. HRESULT hr = E_FAIL;
  36. CLSID curCLSID;
  37. if (dwInstalledVerHi)
  38. memset(dwInstalledVerHi, 0, sizeof(DWORD));
  39. if (dwInstalledVerLo)
  40. memset(dwInstalledVerLo, 0, sizeof(DWORD));
  41. if (CLSIDFromString((LPOLESTR)pwszIEFeature, &curCLSID) != ERROR_SUCCESS)
  42. {
  43. hr = S_FALSE;
  44. goto Cleanup;
  45. }
  46. if (IsEqualCLSID(curCLSID, CLSID_JAVA_VM))
  47. {
  48. HMODULE hLibJava = NULL;
  49. typedef BOOL (WINAPI *LPISVMINSTALLED)();
  50. LPISVMINSTALLED lpfnIsVMInstalled;
  51. hr = ERROR_PRODUCT_UNINSTALLED; /* We are handling it in any case */
  52. if ((hLibJava = LoadLibrary(JAVA_DLL)) != NULL)
  53. {
  54. lpfnIsVMInstalled = (LPISVMINSTALLED)GetProcAddress(hLibJava, szVMInstalled);
  55. if (lpfnIsVMInstalled)
  56. {
  57. if (lpfnIsVMInstalled())
  58. hr = S_OK;
  59. }
  60. FreeLibrary(hLibJava);
  61. }
  62. }
  63. Cleanup:
  64. return hr;
  65. }