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.

116 lines
3.6 KiB

  1. /*======================================================================================//
  2. | Process Control //
  3. | //
  4. |Copyright (c) 1998 Sequent Computer Systems, Incorporated. All rights reserved. //
  5. | //
  6. |File Name: Globals.h //
  7. | //
  8. |Description:
  9. | //
  10. |Created: Paul Skoglund 07-1998 //
  11. | //
  12. |Rev History: //
  13. | //
  14. |=======================================================================================*/
  15. //////////////////////////////////////////////////////////////////////////////////////////
  16. // taken and modified from MMC SDK
  17. //
  18. #ifndef __GLOBALS_H_
  19. #define __GLOBALS_H_
  20. #include "ProcCon.h"
  21. #include "..\Library\ProcConApi.h"
  22. #include "resource.h"
  23. // GetWatermarks() and PSH_WIZARD97 related
  24. #define USE_WIZARD97_HEADERS 1
  25. #define USE_WIZARD97_WATERMARKS 0
  26. #define _ATL_DEBUG_REFCOUNT
  27. #define ARRAY_SIZE(_X_) (sizeof(_X_)/sizeof(_X_[0]) )
  28. const int MAX_ITEM_LEN = 256;
  29. typedef TCHAR ITEM_STR[MAX_ITEM_LEN];
  30. const int SNAPIN_MAX_COMPUTERNAME_LENGTH = 256;
  31. const PCUINT32 COM_BUFFER_SIZE = PC_MAX_BUF_SIZE;
  32. //---------------------------------------------------------------------------
  33. // Global function defines
  34. //
  35. //---------------------------------------------------------------------------
  36. template<class TYPE>
  37. inline void SAFE_RELEASE( TYPE*& pObj )
  38. {
  39. if( NULL != pObj )
  40. {
  41. pObj->Release();
  42. pObj = NULL;
  43. }
  44. else
  45. {
  46. ATLTRACE( _T("Release called on NULL interface pointer \n") );
  47. }
  48. } // end SAFE_RELEASE()
  49. typedef struct {
  50. DWORD dwIDC;
  51. DWORD dwIDH;
  52. } IDCsToIDHs;
  53. class CBaseNode;
  54. class CDataObject;
  55. typedef struct {
  56. #pragma pack(1)
  57. BOOL bLocalComputer;
  58. WCHAR RemoteComputer[SNAPIN_MAX_COMPUTERNAME_LENGTH + 1];
  59. #pragma pack()
  60. } COMPUTER_CONNECTION_INFO;
  61. typedef struct {
  62. CBaseNode *pFolder;
  63. COMPUTER_CONNECTION_INFO Target;
  64. int nHint; // potential quick find hint after change...
  65. BOOL bScopeItem;
  66. int nPageRef;
  67. } PROPERTY_CHANGE_HDR;
  68. PROPERTY_CHANGE_HDR * AllocPropChangeInfo(CBaseNode *pFolder, int nHint, COMPUTER_CONNECTION_INFO &Target, BOOL bScopeItem, int nPageRef);
  69. PROPERTY_CHANGE_HDR * FreePropChangeInfo(PROPERTY_CHANGE_HDR * pInfo);
  70. const TCHAR *LoadStringHelper(ITEM_STR Out, int id);
  71. HRESULT UpdateRegistryHelper(int id, BOOL bRegister);
  72. HRESULT ExtractFromDataObject( LPDATAOBJECT ipDataObject,
  73. UINT cf,
  74. SIZE_T cb,
  75. HGLOBAL *phGlobal
  76. );
  77. CBaseNode* ExtractBaseObject( LPDATAOBJECT ipDataObject );
  78. CDataObject* ExtractOwnDataObject( LPDATAOBJECT ipDataObject );
  79. BOOL IsMMCMultiSelectDataObject(IDataObject* pDataObject);
  80. BOOL ReportPCError(DWORD nLastError, HWND hwnd);
  81. TCHAR *FormatErrorMessageIntoBuffer(DWORD nLastError);
  82. #endif // __GLOBALS_H_