test: cmsubs3.c File Reference

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

# cmsubs3.c File Reference

`#include "cmp.h"`

Go to the source code of this file.

## Functions

VOID | CmpLockRegistry (VOID)
VOID | CmpLockRegistryExclusive (VOID)
VOID | CmpUnlockRegistry ()

## Variables

ERESOURCE | CmpRegistryLock
PVOID | CmpCaller
PVOID | CmpCallerCaller

## Function Documentation

VOID CmpLockRegistry | ( | VOID |  | ) |

Definition at line 44 of file cmsubs3.c.

References CML_FLOW, CMLOG, CmpRegistryLock, CMS_LOCKING, ExAcquireResourceShared, KeEnterCriticalRegion, RtlGetCallersAddress(), and TRUE.

    00049                    :
    00050
    00051     Lock the registry for shared (read-only) access
    00052
    00053 Arguments:
    00054
    00055     None.
    00056
    00057 Return Value:
    00058
    00059     None, the registry lock will be held for shared access upon return.
    00060
    00061 --*/
    00062 {
    00063     #if DBG
    00064     PVOID       Caller;
    00065     PVOID       CallerCaller;
    00066     #endif
    00067
    00068     KeEnterCriticalRegion();
    00069     ExAcquireResourceShared(&CmpRegistryLock, TRUE);
    00070
    00071     #if DBG
    00072     RtlGetCallersAddress(&Caller, &CallerCaller);
    00073     CMLOG(CML_FLOW, CMS_LOCKING) {
    00074         KdPrint(("CmpLockRegistry: c, cc: %08lx  %08lx\n", Caller, CallerCaller));
    00075     }
    00076     #endif
    00077
    00078 }

VOID CmpLockRegistryExclusive | ( | VOID |  | ) |

Definition at line 81 of file cmsubs3.c.

References CmpCaller, CmpCallerCaller, CmpRegistryLock, ExAcquireResourceExclusive, KeEnterCriticalRegion, RtlGetCallersAddress(), Status, and TRUE.

Referenced by CmDeleteKey(), CmDeleteValueKey(), CmGetSystemDriverList(), CmInitSystem1(), CmNotifyRunDown(), CmpCloneControlSet(), CmpCloneHwProfile(), CmpFileSetSize(), CmpInitHiveFromFile(), CmpLoadHiveVolatile(), CmpRefreshHive(), CmpSaveBootControlSet(), CmpSaveKeyByFileCopy(), CmpSecurityMethod(), CmReplaceKey(), CmRestoreKey(), CmSaveKey(), CmSaveMergedKeys(), CmSetLastWriteTimeKey(), CmSetValueKey(), CmShutdownSystem(), CmUnloadKey(), NtCreateKey(), NtInitializeRegistry(), NtNotifyChangeMultipleKeys(), NtQueryOpenSubKeys(), and NtUnloadKey().

    00086                    :
    00087
    00088     Lock the registry for exclusive (write) access.
    00089
    00090 Arguments:
    00091
    00092     CanWait - Supplies whether or not the call should wait
    00093               for the resource or return immediately.
    00094
    00095               If CanWait is TRUE, this will always return
    00096               TRUE.
    00097
    00098 Return Value:
    00099
    00100     TRUE - Lock was acquired exclusively
    00101
    00102     FALSE - Lock is owned by another thread.
    00103
    00104 --*/
    00105 {
    00106     BOOLEAN Status;
    00107
    00108
    00109     KeEnterCriticalRegion();
    00110     ExAcquireResourceExclusive(&CmpRegistryLock,TRUE);
    00111
    00112     RtlGetCallersAddress(&CmpCaller, &CmpCallerCaller);
    00113 }

VOID CmpUnlockRegistry | ( |  | ) |

Definition at line 116 of file cmsubs3.c.

References ASSERT_CM_LOCK_OWNED, CmpRegistryLock, ExReleaseResource, and KeLeaveCriticalRegion.

    00120                    :
    00121
    00122     Unlock the registry.
    00123
    00124 --*/
    00125 {
    00126     ASSERT_CM_LOCK_OWNED();
    00127     ExReleaseResource(&CmpRegistryLock);
    00128     KeLeaveCriticalRegion();
    00129 }

## Variable Documentation

PVOID CmpCaller

| Definition at line 40 of file cmsubs3.c. Referenced by CmpLockRegistryExclusive().

PVOID CmpCallerCaller

| Definition at line 41 of file cmsubs3.c. Referenced by CmpLockRegistryExclusive().

ERESOURCE CmpRegistryLock

| Definition at line 38 of file cmsubs3.c.