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.

159 lines
4.0 KiB

  1. /*++
  2. Copyright (c) 1994-95 Microsoft Corporation
  3. Module Name:
  4. llsmgr.h
  5. Abstract:
  6. Application object implementation.
  7. Author:
  8. Don Ryan (donryan) 12-Feb-1995
  9. Environment:
  10. User Mode - Win32
  11. Revision History:
  12. Jeff Parham (jeffparh) 15-Dec-1995
  13. Removed use of "llsimp.h" (which duplicated select info from system
  14. header files) and "llsapi.h" (which has been folded into stdafx.h),
  15. transferring all unduplicated information to the tail of this file.
  16. --*/
  17. #ifndef _LLSMGR_H_
  18. #define _LLSMGR_H_
  19. #ifndef __AFXWIN_H__
  20. #error include 'stdafx.h' before including this file for PCH
  21. #endif
  22. #include "resource.h"
  23. #include "imagelst.h"
  24. #include "utils.h"
  25. //
  26. // Collections
  27. //
  28. #include "prdcol.h"
  29. #include "liccol.h"
  30. #include "mapcol.h"
  31. #include "usrcol.h"
  32. #include "sstcol.h"
  33. #include "stacol.h"
  34. #include "domcol.h"
  35. #include "srvcol.h"
  36. #include "svccol.h"
  37. //
  38. // Collection items
  39. //
  40. #include "prdobj.h"
  41. #include "licobj.h"
  42. #include "mapobj.h"
  43. #include "usrobj.h"
  44. #include "sstobj.h"
  45. #include "staobj.h"
  46. #include "domobj.h"
  47. #include "srvobj.h"
  48. #include "svcobj.h"
  49. #include "ctlobj.h"
  50. #include "appobj.h"
  51. class CLlsmgrApp : public CWinApp
  52. {
  53. private:
  54. BOOL m_bIsAutomated;
  55. CApplication* m_pApplication;
  56. CSingleDocTemplate* m_pDocTemplate;
  57. #ifdef _DEBUG
  58. CMemoryState m_initMem;
  59. #endif
  60. public:
  61. CImageList m_smallImages;
  62. CImageList m_largeImages;
  63. public:
  64. CLlsmgrApp();
  65. CDocTemplate* GetDocTemplate();
  66. CApplication* GetApplication();
  67. IDispatch* GetAppIDispatch();
  68. BOOL OnAppStartup();
  69. void DisplayStatus(long NtStatus);
  70. void DisplayLastStatus();
  71. //{{AFX_VIRTUAL(CLlsmgrApp)
  72. public:
  73. virtual BOOL InitInstance();
  74. virtual int ExitInstance();
  75. virtual CDocument* OpenDocumentFile(LPCTSTR lpszFileName);
  76. //}}AFX_VIRTUAL
  77. //{{AFX_MSG(CLlsmgrApp)
  78. afx_msg void OnAppAbout();
  79. //}}AFX_MSG
  80. virtual void WinHelp( DWORD_PTR dwData, UINT nCmd );
  81. DECLARE_MESSAGE_MAP()
  82. friend class CApplication; // accesses m_pApplication;
  83. };
  84. extern CLlsmgrApp theApp;
  85. inline CDocTemplate* CLlsmgrApp::GetDocTemplate()
  86. { return m_pDocTemplate; }
  87. inline CApplication* CLlsmgrApp::GetApplication()
  88. { return m_pApplication; }
  89. inline IDispatch* CLlsmgrApp::GetAppIDispatch()
  90. { return m_pApplication->GetIDispatch(TRUE); }
  91. inline CCmdTarget* GetObjFromIDispatch(IDispatch* pIDispatch)
  92. { return pIDispatch ? CCmdTarget::FromIDispatch(pIDispatch) : NULL; }
  93. #define MKSTR(x) ((LPTSTR)(LPCTSTR)(x))
  94. #define MKOBJ(x) (::GetObjFromIDispatch(x))
  95. #define LlsGetApp() (theApp.GetApplication())
  96. #define LlsGetLastStatus() (theApp.GetApplication()->GetLastStatus())
  97. #define LlsSetLastStatus(s) (theApp.GetApplication()->SetLastStatus((s)))
  98. #define LlsGetActiveHandle() (theApp.GetApplication()->GetActiveHandle())
  99. #define LlsGetLastTargetServer() (theApp.GetApplication()->GetLastTargetServer())
  100. #define LlsSetLastTargetServer(s) (theApp.GetApplication()->SetLastTargetServer(s))
  101. #define IsConnectionDropped(Status) \
  102. (((NTSTATUS)(Status) == STATUS_INVALID_HANDLE) || \
  103. ((NTSTATUS)(Status) == RPC_NT_SERVER_UNAVAILABLE) || \
  104. ((NTSTATUS)(Status) == RPC_NT_SS_CONTEXT_MISMATCH) || \
  105. ((NTSTATUS)(Status) == RPC_S_SERVER_UNAVAILABLE) || \
  106. ((NTSTATUS)(Status) == RPC_S_CALL_FAILED))
  107. #define LLS_PREFERRED_LENGTH ((DWORD)-1L)
  108. #define V_ISVOID(va) \
  109. ( \
  110. (V_VT(va) == VT_EMPTY) || \
  111. (V_VT(va) == VT_ERROR && V_ERROR(va) == DISP_E_PARAMNOTFOUND) \
  112. )
  113. #define LLS_DESIRED_ACCESS (STANDARD_RIGHTS_REQUIRED |\
  114. POLICY_VIEW_LOCAL_INFORMATION |\
  115. POLICY_LOOKUP_NAMES )
  116. #endif // _LLSMGR_H_