?? cobject.c
字號(hào):
/****************************************************************************** CObject.c : Implementation of CObject class * REALmagic Quasar Hardware Library* Created by Michael Ignaszewski* Copyright Sigma Designs Inc* Sigma Designs Proprietary and confidential* Created on 8/27/98* Description:*****************************************************************************/// Implementation of CObject object.#include "pch.h"#include "cobject.h"// CObject vtable definitionIObjectVtbl g_CObjectlpVtbl = {CObject__Delete};/////////////////////////////////////////////////////////////////////// CObject New //@func void | CObject__New | Create a new instance of a CObject object.//@parm CObject** | ppCObject | return address of the object we are about to create.//@parm TCHAR* | pName | friendly name of the object.//@parm BOOL | bAllocate | if TRUE we allocate the memory for the object. If FALSE, the memory has already been allocated.//@parm DWORD | dwInstance | instance of the driver.//@parm void* | pModuleInfo | pointer to a ModuleInfo structure.//@rdesc voidvoid CObject__New (CObject **ppCObject, TCHAR *pName, BOOL bAllocate, DWORD dwInstance){ CObject *pCObject = *ppCObject; if (bAllocate) { // Allocate Object *ppCObject = OSmalloc(sizeof(CObject)); pCObject = *ppCObject; if(pCObject == NULL) return; OSmemset(pCObject, 0, sizeof(CObject)); } pCObject->m_dwInstance = dwInstance;#ifdef DEBUG pCObject->m_pFriendlyName = pName;#endif // Init VTable pCObject->lpVtbl = &g_CObjectlpVtbl; // Init Members }/////////////////////////////////////////////////////////////////////// CObject Delete //@func void | CObject__Delete | Delete CObject object. //@parm IObject* | This | Pointer to the IObject interface.//@parm BOOL | bDeleteObject | if TRUE, delete object, if FALSE the object will be deleted by the callee.//@rdesc voidvoid CObject__Delete (IObject * This, BOOL bDeleteObject){ CObject* pCObject = (CObject*) This; // Sanity check if (This == NULL) return; if (bDeleteObject) { // Delete Object OSfree(pCObject); }}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -