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
00074
00075
return;
00076 }
00077
00078
CmpLockRegistry();
00079
00080 KeyBody = (
PCM_KEY_BODY)Object;
00081
00082
00083
00084
00085
00086
if (KeyBody->
Type ==
KEY_BODY_TYPE) {
00087
00088
00089
00090
if (KeyBody->
NotifyBlock !=
NULL) {
00091
00092
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 }
}