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

cmclose.c

Go to the documentation of this file.
00001 /*++ 00002 00003 Copyright (c) 1991 Microsoft Corporation 00004 00005 Module Name: 00006 00007 cmclose.c 00008 00009 Abstract: 00010 00011 This module contains the close object method. 00012 00013 Author: 00014 00015 Bryan M. Willman (bryanwi) 07-Jan-92 00016 00017 Revision History: 00018 00019 --*/ 00020 00021 #include "cmp.h" 00022 00023 #ifdef ALLOC_PRAGMA 00024 #pragma alloc_text(PAGE,CmpCloseKeyObject) 00025 #endif 00026 00027 VOID 00028 CmpCloseKeyObject( 00029 IN PEPROCESS Process OPTIONAL, 00030 IN PVOID Object, 00031 IN ACCESS_MASK GrantedAccess, 00032 IN ULONG ProcessHandleCount, 00033 IN ULONG SystemHandleCount 00034 ) 00035 /*++ 00036 00037 Routine Description: 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:39:26 2004 for test by doxygen 1.3.7