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

cmclose.c File Reference

#include "cmp.h"

Go to the source code of this file.

Functions

VOID CmpCloseKeyObject (IN PEPROCESS Process OPTIONAL, IN PVOID Object, IN ACCESS_MASK GrantedAccess, IN ULONG ProcessHandleCount, IN ULONG SystemHandleCount)


Function Documentation

VOID CmpCloseKeyObject IN PEPROCESS Process  OPTIONAL,
IN PVOID  Object,
IN ACCESS_MASK  GrantedAccess,
IN ULONG  ProcessHandleCount,
IN ULONG  SystemHandleCount
 

Definition at line 28 of file cmclose.c.

References CML_MAJOR, CmLockHive, CMLOG, CmpLockRegistry(), CmpPostNotify(), CmpUnlockRegistry(), CMS_NTAPI, CMS_POOL, CmUnlockHive, FALSE, KEY_BODY_TYPE, _CM_KEY_BODY::KeyControlBlock, _CM_KEY_CONTROL_BLOCK::KeyHive, _CM_KEY_BODY::NotifyBlock, NULL, PAGED_CODE, PCM_NOTIFY_BLOCK, _CM_NOTIFY_BLOCK::PostList, and _CM_KEY_BODY::Type.

Referenced by CmpCreateObjectTypes().

00037 : 00038 00039 This routine interfaces to the NT Object Manager. It is invoked when 00040 a Key object (or Key Root object) is closed. 00041 00042 It's function is to do cleanup processing by waking up any notifies 00043 pending on the handle. This keeps the key object from hanging around 00044 forever because a synchronous notify is stuck on it somewhere. 00045 00046 All other cleanup, in particular, the freeing of storage, will be 00047 done in CmpDeleteKeyObject. 00048 00049 Arguments: 00050 00051 Process - ignored 00052 00053 Object - supplies a pointer to a KeyRoot or Key, thus -> KEY_BODY. 00054 00055 GrantedAccess, ProcessHandleCount, SystemHandleCount - ignored 00056 00057 Return Value: 00058 00059 NONE. 00060 00061 --*/ 00062 { 00063 PCM_KEY_BODY KeyBody; 00064 PCM_NOTIFY_BLOCK NotifyBlock; 00065 00066 PAGED_CODE(); 00067 CMLOG(CML_MAJOR, CMS_NTAPI|CMS_POOL) { 00068 KdPrint(("CmpCloseKeyObject: Object = %08lx\n", Object)); 00069 } 00070 00071 if( SystemHandleCount > 1 ) { 00072 // 00073 // There are still has open handles on this key. Do nothing 00074 // 00075 return; 00076 } 00077 00078 CmpLockRegistry(); 00079 00080 KeyBody = (PCM_KEY_BODY)Object; 00081 00082 // 00083 // Check the type, it will be something else if we are closing a predefined 00084 // handle key 00085 // 00086 if (KeyBody->Type == KEY_BODY_TYPE) { 00087 // 00088 // Clean up any outstanding notifies attached to the KeyBody 00089 // 00090 if (KeyBody->NotifyBlock != NULL) { 00091 // 00092 // Post all PostBlocks waiting on the NotifyBlock 00093 // 00094 NotifyBlock = KeyBody->NotifyBlock; 00095 if (IsListEmpty(&(NotifyBlock->PostList)) == FALSE) { 00096 CmLockHive((PCMHIVE)(KeyBody->KeyControlBlock->KeyHive)); 00097 CmpPostNotify(NotifyBlock, 00098 NULL, 00099 0, 00100 STATUS_NOTIFY_CLEANUP, 00101 NULL); 00102 CmUnlockHive((PCMHIVE)(KeyBody->KeyControlBlock->KeyHive)); 00103 } 00104 } 00105 } 00106 00107 CmpUnlockRegistry(); 00108 return; 00109 } }


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