Previous Next

ZwFlushKey

The ZwFlushKey routine forces a registry key to be committed to disk.

NTSTATUS 
  ZwFlushKey(
    IN HANDLE  KeyHandle
    );

Parameters

KeyHandle
Handle to the registry key to be flushed to disk. This handle is created by a successful call to ZwCreateKey or ZwOpenKey.

Headers

Declared in ntddk.h. Include ntddk.h.

Return Value

ZwFlushKey returns STATUS_SUCCESS if the key information was transferred to disk, or the appropriate error code on failure.

Comments

Changes made by ZwCreateKey or ZwSetValueKey can be flushed to disk with ZwFlushKey. This routine does not return to its caller until any changed data associated with the given KeyHandle has been written to permanent store.

Note  This routine can flush the entire registry. Accordingly, it can generate a great deal of I/O. Since the system automatically flushes key changes every few seconds, it is seldom necessary to call ZwFlushKey.

Callers of ZwFlushKey must be running at IRQL = PASSIVE_LEVEL.

See Also

ZwCreateKey, ZwOpenKey, ZwSetValueKey