📄 wmsnodeauthmodule.cpp
字号:
#include "StdAfx.h"#include "WarMmcSnapin.h"#include "WmsNodeAuthModule.h" // class implemented#include "WarCollector.h"#include "WarIfServer.h"#include "WarIfAuthModule.h"#include "PropPageAuthModuleGeneral.h"#include "PropPageAuthModuleWindows.h"/////////////////////////////// PUBLIC ///////////////////////////////////////// {A8EE730B-3110-4136-8473-B11873B45C1F}const GUID WmsNodeAuthModule::thisGuid = { 0xa8ee730b, 0x3110, 0x4136, { 0x84, 0x73, 0xb1, 0x18, 0x73, 0xb4, 0x5c, 0x1f } };WmsNodeAuthModule::WmsNodeAuthModule(war_if_site_ptr_t& rSitePtr, war_if_aut_module_ptr_t& rAuthPtr): mSitePtr(rSitePtr), mAuthPtr(rAuthPtr){}WmsNodeAuthModule::~WmsNodeAuthModule(){}//============================= LIFECYCLE ====================================//============================= OPERATORS ====================================//============================= OPERATIONS ===================================//============================= CALLBACK ===================================HRESULT WmsNodeAuthModule::OnSelect(IConsole *pConsole, BOOL bScope, BOOL bSelect){ IConsoleVerb *pConsoleVerb; HRESULT hr = pConsole->QueryConsoleVerb(&pConsoleVerb); _ASSERT(SUCCEEDED(hr)); //hr = pConsoleVerb->SetVerbState(MMC_VERB_RENAME, ENABLED, TRUE); // can't get to properties (via the standard methods) unless // we tell MMC to display the Properties menu item and // toolbar button, this wil give the user a visual cue that // there's "something" to do hr = pConsoleVerb->SetVerbState(MMC_VERB_PROPERTIES, ENABLED, TRUE); pConsoleVerb->Release(); return S_OK;}HRESULT WmsNodeAuthModule::CreatePropertyPages(IPropertySheetCallback *lpProvider, LONG_PTR handle){ AFX_MANAGE_STATE(AfxGetStaticModuleState()); CPropertyPage *pprop_page = NULL; pprop_page = new CPropPageAuthModuleGeneral(mAuthPtr); HRESULT hr = MMCPropPageCallback(&pprop_page->m_psp); if (SUCCEEDED(hr)) { PROPSHEETPAGE psp; memset(&psp, 0, sizeof(psp)); memcpy(&psp, &pprop_page->m_psp, sizeof(pprop_page->m_psp)); psp.dwFlags = PSP_DEFAULT | PSP_USECALLBACK; HPROPSHEETPAGE hpage = CreatePropertySheetPage(&psp); if (NULL == hpage) return E_UNEXPECTED; lpProvider->AddPage(hpage); } if (mAuthPtr->GetType() == WarIfAuthModule::AMT_WINNT) { pprop_page = new CPropPageAuthModuleWindows(mAuthPtr); HRESULT hr = MMCPropPageCallback(&pprop_page->m_psp); if (SUCCEEDED(hr)) { PROPSHEETPAGE psp; memset(&psp, 0, sizeof(psp)); memcpy(&psp, &pprop_page->m_psp, sizeof(pprop_page->m_psp)); psp.dwFlags = PSP_DEFAULT | PSP_USECALLBACK; HPROPSHEETPAGE hpage = CreatePropertySheetPage(&psp); if (NULL == hpage) return E_UNEXPECTED; lpProvider->AddPage(hpage); } } return S_OK;}//============================= ACCESS ===================================//============================= INQUIRY ===================================const int WmsNodeAuthModule::GetBitmapIndex(){ return mAuthPtr->IsEnabled() ? NICON_AUTH_MODULE : NICON_AUTH_MODULE_DISABLED;}const _TCHAR *WmsNodeAuthModule::GetDisplayName(int nCol){ switch(nCol) { case 0: return mAuthPtr->GetName(); case 1: return mAuthPtr->GetModuleTypeName(); default: return _T("Invalid column index"); }}const GUID & WmsNodeAuthModule::getNodeType(){ return thisGuid; }/////////////////////////////// PROTECTED ////////////////////////////////////////////////////////////////// PRIVATE ///////////////////////////////////
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -