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.

53 lines
1.1 KiB

  1. #include "stdafx.h"
  2. #include "ocmanage.h"
  3. #include "setupapi.h"
  4. #include "utils.h"
  5. extern OCMANAGER_ROUTINES gHelperRoutines;
  6. extern HANDLE gMyModuleHandle;
  7. void SetIMSSetupMode(DWORD dwSetupMode)
  8. {
  9. gHelperRoutines.SetSetupMode(gHelperRoutines.OcManagerContext, dwSetupMode);
  10. }
  11. DWORD GetIMSSetupMode()
  12. {
  13. return(gHelperRoutines.GetSetupMode(gHelperRoutines.OcManagerContext));
  14. }
  15. void PopupOkMessageBox(DWORD dwMessageId, LPCTSTR szCaption)
  16. {
  17. CString csText;
  18. MyLoadString(dwMessageId, csText);
  19. MyMessageBox(NULL, csText, szCaption,
  20. MB_OK | MB_TASKMODAL | MB_SETFOREGROUND | MB_TOPMOST);
  21. }
  22. // C:\Inetpub\wwwroot ===> C:\Inetpub
  23. BOOL GetParentDir(LPCTSTR szPath, LPTSTR szParentDir)
  24. {
  25. LPTSTR p = (LPTSTR)szPath;
  26. if (!szPath || !*szPath)
  27. return(FALSE);
  28. while (*p)
  29. p++;
  30. p--;
  31. while (p >= szPath && *p != _T('\\'))
  32. p--;
  33. *szParentDir = _T('\0');
  34. if (p == szPath)
  35. lstrcpy(szParentDir, _T("\\"));
  36. else
  37. lstrcpyn(szParentDir, szPath, (size_t)(p - szPath + 1));
  38. return(TRUE);
  39. }