📄 warmmcsnapin.h
字号:
/** WarMmcSnapin.h*/#ifndef WAR_MMC_SNAPIN_H#define WAR_MMC_SNAPIN_H/* SYSTEM INCLUDES *//* PROJECT INCLUDES */#include "resource.h"/* LOCAL INCLUDES *//* FORWARD REFERENCES */void MMCN_Crack(BOOL bComponentData, IDataObject *pDataObject, IComponentData *pCompData, IComponent *pComp, MMC_NOTIFY_TYPE event, LPARAM arg, LPARAM param);/* GLOBALS */extern HINSTANCE g_hinst;extern ULONG g_uObjects;extern ULONG g_uSrvLock;#ifdef __cplusplusextern "C" {#endif/****************** BEGIN OLD STYLE C spesific ********/#ifdef WARMMCSNAPIN_EXPORTS#define WARMMCSNAPIN_API __declspec(dllexport)#else#define WARMMCSNAPIN_API __declspec(dllimport)#endif#define OBJECT_CREATED InterlockedIncrement((long *)&g_uObjects);#define OBJECT_DESTROYED InterlockedDecrement((long *)&g_uObjects);enum NodeIconsE{ NICON_NONE = -1, NICON_WORKSTATION = 0, NICON_FOLDER, NICON_OPEN_FOLDER, NICON_SERVICE, NICON_CURRACT, NICON_SERVER_LOG, NICON_LOG_MODULES, NICON_LOG_MODULE_CONFIG, NICON_OPTIONS, NICON_LOG, NICON_SITE, NICON_LOG_MODULE_CONFIG_DISABLED, NICON_SITE_DISABLED, NICON_SITE_SECURITY, NICON_SHARE, NICON_SITE_LOG, NICON_AUTH_MODULE, NICON_AUTH_MODULE_DISABLED, NICON_USER_FOLDER, NICON_USER, NICON_USER_DISABLED, NICON_SHARE_DENIED, NICON_SHARE_RECURSIVE, NICON_SHARE_DENIED_RECURSIVE, NICON_PROTOCOL, NICON_FOLDER_DISABLED, NICON_INVALID};/****************** END OLD STYLE C spesific **********/#ifdef __cplusplus }#endif/****************** BEGIN C++ spesific ****************/#ifdef __cplusplus//=--------------------------------------------------------------------------=// allocates a temporary buffer that will disappear when it goes out of scope// NOTE: be careful of that -- make sure you use the string in the same or// nested scope in which you created this buffer. people should not use this// class directly. use the macro(s) below.//class TempBuffer { public: TempBuffer(ULONG cBytes) { m_pBuf = (cBytes <= 120) ? &m_szTmpBuf : HeapAlloc(GetProcessHeap(), 0, cBytes); m_fHeapAlloc = (cBytes > 120); } ~TempBuffer() { if (m_pBuf && m_fHeapAlloc) HeapFree(GetProcessHeap(), 0, m_pBuf); } void *GetBuffer() { return m_pBuf; } private: void *m_pBuf; // we'll use this temp buffer for small cases. // char m_szTmpBuf[120]; unsigned m_fHeapAlloc:1;};//=--------------------------------------------------------------------------=// string helpers.//// given a _TCHAR, copy it into a wide buffer.// be careful about scoping when using this macro!//// how to use the below two macros://// ...// LPTSTR pszT;// pszT = MyGetTStringRoutine();// MAKE_WIDEPTR_FROMSTR(pwsz, pszT);// MyUseWideStringRoutine(pwsz);// ...#ifdef UNICODE#define MAKE_WIDEPTR_FROMTSTR(ptrname, tstr) \ long __l##ptrname = (lstrlenW(tstr) + 1) * sizeof(WCHAR); \ TempBuffer __TempBuffer##ptrname(__l##ptrname); \ lstrcpyW((LPWSTR)__TempBuffer##ptrname.GetBuffer(), tstr); \ LPWSTR ptrname = (LPWSTR)__TempBuffer##ptrname.GetBuffer()#else // ANSI#define MAKE_WIDEPTR_FROMTSTR(ptrname, tstr) \ long __l##ptrname = (lstrlenA(tstr) + 1) * sizeof(WCHAR); \ TempBuffer __TempBuffer##ptrname(__l##ptrname); \ MultiByteToWideChar(CP_ACP, 0, tstr, -1, (LPWSTR)__TempBuffer##ptrname.GetBuffer(), __l##ptrname); \ LPWSTR ptrname = (LPWSTR)__TempBuffer##ptrname.GetBuffer()#endif#ifdef UNICODE#define MAKE_WIDEPTR_FROMTSTR_ALLOC(ptrname, tstr) \ long __l##ptrname = (lstrlenW(tstr) + 1) * sizeof(WCHAR); \ LPWSTR ptrname = (LPWSTR)CoTaskMemAlloc(__l##ptrname); \ lstrcpyW((LPWSTR)ptrname, tstr)#else // ANSI#define MAKE_WIDEPTR_FROMTSTR_ALLOC(ptrname, tstr) \ long __l##ptrname = (lstrlenA(tstr) + 1) * sizeof(WCHAR); \ LPWSTR ptrname = (LPWSTR)CoTaskMemAlloc(__l##ptrname); \ MultiByteToWideChar(CP_ACP, 0, tstr, -1, ptrname, __l##ptrname)#endif//// similarily for MAKE_TSTRPTR_FROMWIDE. note that the first param does not// have to be declared, and no clean up must be done.//// * 2 for DBCS handling in below length computation//#ifdef UNICODE#define MAKE_TSTRPTR_FROMWIDE(ptrname, widestr) \ long __l##ptrname = (wcslen(widestr) + 1) * 2 * sizeof(TCHAR); \ TempBuffer __TempBuffer##ptrname(__l##ptrname); \ lstrcpyW((LPTSTR)__TempBuffer##ptrname.GetBuffer(), widestr); \ LPTSTR ptrname = (LPTSTR)__TempBuffer##ptrname.GetBuffer()#else // ANSI#define MAKE_TSTRPTR_FROMWIDE(ptrname, widestr) \ long __l##ptrname = (wcslen(widestr) + 1) * 2 * sizeof(TCHAR); \ TempBuffer __TempBuffer##ptrname(__l##ptrname); \ WideCharToMultiByte(CP_ACP, 0, widestr, -1, (LPSTR)__TempBuffer##ptrname.GetBuffer(), __l##ptrname, NULL, NULL); \ LPTSTR ptrname = (LPTSTR)__TempBuffer##ptrname.GetBuffer()#endif/* INLINE METHODS *//* EXTERNAL REFERENCES */#endif /* __cplusplus *//****************** END C++ spesific ******************/#endif /* WAR_MMC_SNAPIN_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -