Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

cmdelete.c File Reference

#include "cmp.h"

Go to the source code of this file.

Functions

VOID CmpDeleteKeyObject (IN PVOID Object)


Function Documentation

VOID CmpDeleteKeyObject IN PVOID  Object  ) 
 

Definition at line 31 of file cmdelete.c.

References ASSERT, CML_MAJOR, CMLOG, CmpDereferenceKeyControlBlock(), CmpFlushNotify(), CmpLockRegistry(), CmpUnlockRegistry(), CMS_NTAPI, DELIST_KEYBODY_FROM_KEYBODY_LIST, _CM_KEY_CONTROL_BLOCK::Flags, KEY_BODY_TYPE, KEY_PREDEF_HANDLE, _CM_KEY_BODY::KeyControlBlock, NULL, PAGED_CODE, REG_PREDEF_HANDLE_MASK, and _CM_KEY_BODY::Type.

Referenced by CmpCreateObjectTypes().

00036 : 00037 00038 This routine interfaces to the NT Object Manager. It is invoked when 00039 the last reference to a particular Key object (or Key Root object) 00040 is destroyed. 00041 00042 If the Key object going away holds the last reference to 00043 the extension it is associated with, that extension is destroyed. 00044 00045 Arguments: 00046 00047 Object - supplies a pointer to a KeyRoot or Key, thus -> KEY_BODY. 00048 00049 Return Value: 00050 00051 NONE. 00052 00053 --*/ 00054 { 00055 PCM_KEY_CONTROL_BLOCK KeyControlBlock; 00056 PCM_KEY_BODY KeyBody; 00057 00058 PAGED_CODE(); 00059 00060 CMLOG(CML_MAJOR, CMS_NTAPI) { 00061 KdPrint(("CmpDeleteKeyObject: Object = %08lx\n", Object)); 00062 } 00063 00064 CmpLockRegistry(); 00065 00066 KeyBody = (PCM_KEY_BODY)Object; 00067 00068 if (KeyBody->Type==KEY_BODY_TYPE) { 00069 KeyControlBlock = KeyBody->KeyControlBlock; 00070 00071 // 00072 // the keybody should be initialized; when kcb is null, something went wrong 00073 // between the creation and the dereferenciation of the object 00074 // 00075 if( KeyControlBlock != NULL ) { 00076 00077 // 00078 // Clean up any outstanding notifies attached to the KeyBody 00079 // 00080 CmpFlushNotify(KeyBody); 00081 00082 // 00083 // Remove our reference to the KeyControlBlock, clean it up, perform any 00084 // pend-till-final-close operations. 00085 // 00086 // NOTE: Delete notification is seen at the parent of the deleted key, 00087 // not the deleted key itself. If any notify was outstanding on 00088 // this key, it was cleared away above us. Only parent/ancestor 00089 // keys will see the report. 00090 // 00091 // 00092 // The dereference will free the KeyControlBlock. If the key was deleted, it 00093 // has already been removed from the hash table, and relevent notifications 00094 // posted then as well. All we are doing is freeing the tombstone. 00095 // 00096 // If it was not deleted, we're both cutting the kcb out of 00097 // the kcb list/tree, AND freeing its storage. 00098 // 00099 00100 DELIST_KEYBODY_FROM_KEYBODY_LIST(KeyBody); 00101 CmpDereferenceKeyControlBlock(KeyControlBlock); 00102 } 00103 } else { 00104 // 00105 // This must be a predefined handle 00106 // some sanity asserts 00107 // 00108 KeyControlBlock = KeyBody->KeyControlBlock; 00109 00110 ASSERT( KeyBody->Type&REG_PREDEF_HANDLE_MASK); 00111 ASSERT( KeyControlBlock->Flags&KEY_PREDEF_HANDLE ); 00112 00113 if( KeyControlBlock != NULL ) { 00114 CmpDereferenceKeyControlBlock(KeyControlBlock); 00115 } 00116 00117 } 00118 CmpUnlockRegistry(); 00119 return; 00120 }


Generated on Sat May 15 19:43:07 2004 for test by doxygen 1.3.7