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

cmwrapr2.c File Reference

#include "cmp.h"

Go to the source code of this file.

Functions

BOOLEAN CmpFileSetSize (PHHIVE Hive, ULONG FileType, ULONG FileSize)

Variables

REGISTRY_COMMAND CommandArea
KEVENT StartRegistryCommand
KEVENT EndRegistryCommand
BOOLEAN CmpNoWrite


Function Documentation

BOOLEAN CmpFileSetSize PHHIVE  Hive,
ULONG  FileType,
ULONG  FileSize
 

Definition at line 45 of file cmwrapr2.c.

References ASSERT, CML_MAJOR, CMLOG, CmpLockRegistryExclusive(), CmpUnlockRegistry(), CmpWorker(), CMS_IO_ERROR, _REGISTRY_COMMAND::Command, FALSE, _REGISTRY_COMMAND::FileSize, _REGISTRY_COMMAND::FileType, _REGISTRY_COMMAND::Hive, Hive, NT_SUCCESS, NTSTATUS(), REG_CMD_FILE_SET_SIZE, _REGISTRY_COMMAND::Status, and TRUE.

00052 : 00053 00054 This routine sets the size of a file. It must not return until 00055 the size is guaranteed, therefore, it does a flush. 00056 00057 It is environment specific. 00058 00059 This routine will force execution to the correct thread context. 00060 00061 Arguments: 00062 00063 Hive - Hive we are doing I/O for 00064 00065 FileType - which supporting file to use 00066 00067 FileSize - 32 bit value to set the file's size to 00068 00069 Return Value: 00070 00071 FALSE if failure 00072 TRUE if success 00073 00074 --*/ 00075 { 00076 NTSTATUS status; 00077 REGISTRY_COMMAND Command; 00078 00079 ASSERT(FIELD_OFFSET(CMHIVE, Hive) == 0); 00080 00081 // 00082 // Wake up worker thread to do real work for us. 00083 // 00084 Command.Command = REG_CMD_FILE_SET_SIZE; 00085 Command.Hive = Hive; 00086 Command.FileType = FileType; 00087 Command.FileSize = FileSize; 00088 CmpLockRegistryExclusive(); 00089 CmpWorker(&Command); 00090 status = Command.Status; 00091 CmpUnlockRegistry(); 00092 00093 if (!NT_SUCCESS(status)) { 00094 CMLOG(CML_MAJOR, CMS_IO_ERROR) { 00095 KdPrint(("CmpFileSetSize:\n\t")); 00096 KdPrint(("Failure: status = %08lx ", status)); 00097 } 00098 return FALSE; 00099 } 00100 00101 return TRUE; 00102 } }


Variable Documentation

BOOLEAN CmpNoWrite
 

Definition at line 41 of file cmwrapr2.c.

REGISTRY_COMMAND CommandArea
 

Definition at line 29 of file cmwrapr2.c.

Referenced by CmpRefreshHive(), CmpSaveKeyByFileCopy(), CmpWorker(), and CmShutdownSystem().

KEVENT EndRegistryCommand
 

Definition at line 31 of file cmwrapr2.c.

KEVENT StartRegistryCommand
 

Definition at line 30 of file cmwrapr2.c.


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