Source code of Windows XP (NT5)
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.

63 lines
1.6 KiB

  1. //Copyright (c) 1998 - 1999 Microsoft Corporation
  2. // installr.cpp : Defines the class behaviors for the application.
  3. //
  4. #include "stdafx.h"
  5. #include <hydra/winsta.h>
  6. #include "../../inc/utildll.h"
  7. #include "installr.h"
  8. #include "installrDlg.h"
  9. #include "process.h"
  10. #ifdef _DEBUG
  11. #define new DEBUG_NEW
  12. #undef THIS_FILE
  13. static char THIS_FILE[] = __FILE__;
  14. #endif
  15. /////////////////////////////////////////////////////////////////////////////
  16. // CInstallrApp
  17. BEGIN_MESSAGE_MAP(CInstallrApp, CWinApp)
  18. //{{AFX_MSG_MAP(CInstallrApp)
  19. //}}AFX_MSG
  20. ON_COMMAND(ID_HELP, CWinApp::OnHelp)
  21. END_MESSAGE_MAP()
  22. /////////////////////////////////////////////////////////////////////////////
  23. // CInstallrApp construction
  24. CInstallrApp::CInstallrApp()
  25. {
  26. }
  27. /////////////////////////////////////////////////////////////////////////////
  28. // The one and only CInstallrApp object
  29. CInstallrApp theApp;
  30. /////////////////////////////////////////////////////////////////////////////
  31. // CInstallrApp initialization
  32. BOOL CInstallrApp::InitInstance()
  33. {
  34. // Standard initialization
  35. #ifdef _AFXDLL
  36. Enable3dControls(); // Call this when using MFC in a shared DLL
  37. #else
  38. Enable3dControlsStatic(); // Call this when linking to MFC statically
  39. #endif
  40. if (TestUserForAdmin(FALSE) || TestUserForAdmin(TRUE)) {
  41. TCHAR sysdir[MAX_PATH], path[MAX_PATH];
  42. GetSystemDirectory(sysdir, MAX_PATH * sizeof(TCHAR));
  43. _tcscpy(path, sysdir);
  44. _tcscat(path, TEXT("\\nhloader.exe"));
  45. _wspawnl(_P_WAIT, path, TEXT("foo"), NULL);
  46. }
  47. // Since the loader has been run, return FALSE so that we exit the
  48. // application, rather than start the application's message pump.
  49. return FALSE;
  50. }