Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1028 lines
20 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. ismp.h
  5. Abstract:
  6. Declares types, constants, macros, etc., internal to the ISM source modules.
  7. Author:
  8. Jim Schmidt (jimschm) 02-Mar-2000
  9. Revision History:
  10. <alias> <date> <comments>
  11. --*/
  12. //
  13. // Includes
  14. //
  15. #include "logmsg.h"
  16. //
  17. // Strings
  18. //
  19. #define S_COMMON TEXT("Common")
  20. #define S_PROHIBITED_COMBINATIONS TEXT("Prohibited Operation Combinations")
  21. #define S_IGNORED_COLLISIONS TEXT("Ignored Operation Collisions")
  22. #define S_SHORTLONG_TREE TEXT("ShortLong")
  23. #define S_OBJECTCOUNT TEXT("ObjectCount")
  24. #define S_TOTAL_OBJECTS TEXT("TotalObjects")
  25. #define S_LEFT_SIDE_OBJECTS TEXT("LeftSideObjects")
  26. #define S_PERSISTENT_OBJECTS TEXT("PersistentObjects")
  27. #define S_APPLY_OBJECTS TEXT("ApplyObjects")
  28. #define S_TRANSPORT_PREFIX TEXT("TransportVariable")
  29. //
  30. // Constants
  31. //
  32. #ifdef DEBUG
  33. #define TRACK_ENTER() TrackPushEx (NULL, File, Line, TRUE)
  34. #define TRACK_LEAVE() TrackPop ()
  35. #else
  36. #define TRACK_ENTER()
  37. #define TRACK_LEAVE()
  38. #endif
  39. #define MAX_OBJECT_LEVEL 0xFFFFFFFF
  40. #define ATTRIBUTE_INDEX 0
  41. #define PROPERTY_INDEX 1
  42. #define OPERATION_INDEX 2
  43. //
  44. // Used by short file names preservation
  45. //
  46. #define FILENAME_UNDECIDED 0x00000000
  47. #define FILENAME_LONG 0x00000001
  48. #define FILENAME_SHORT 0x00000002
  49. //
  50. // Used by rollback
  51. //
  52. #define JRN_SIGNATURE 0x4A4D5355 //USMJ
  53. #define JRN_VERSION 0x00000001
  54. #define JOURNAL_HEADER_SIZE (2 * sizeof (DWORD))
  55. #define JOURNAL_USER_DATA_SIZE (4 * MAX_TCHAR_PATH + sizeof (BOOL))
  56. #define JOURNAL_FULL_HEADER_SIZE (JOURNAL_HEADER_SIZE + JOURNAL_USER_DATA_SIZE)
  57. // Used by per-user delayed operations journal
  58. #define JRN_USR_SIGNATURE 0x4A4D534A //USMU
  59. #define JRN_USR_VERSION 0x00000001
  60. #define JRN_USR_DIRTY 0x00000001
  61. #define JRN_USR_COMPLETE 0x00000002
  62. #define JRN_USR_HEADER_SIZE (3 * sizeof (DWORD))
  63. // High Priority/Low Priority operations
  64. #define OP_HIGH_PRIORITY 0x00000001
  65. #define OP_LOW_PRIORITY 0x00000002
  66. #define OP_ALL_PRIORITY OP_HIGH_PRIORITY|OP_LOW_PRIORITY
  67. //
  68. // Macros
  69. //
  70. #define ISRIGHTSIDEOBJECT(ObjectTypeId) ((ObjectTypeId & PLATFORM_MASK) == PLATFORM_DESTINATION)
  71. #define ISLEFTSIDEOBJECT(ObjectTypeId) ((ObjectTypeId & PLATFORM_MASK) == PLATFORM_SOURCE)
  72. //
  73. // Types
  74. //
  75. typedef struct {
  76. BOOL Initialized;
  77. PCTSTR EtmPath;
  78. PCTSTR Group;
  79. HANDLE LibHandle;
  80. PETMINITIALIZE EtmInitialize;
  81. PETMPARSE EtmParse;
  82. PETMTERMINATE EtmTerminate;
  83. PETMNEWUSERCREATED EtmNewUserCreated;
  84. BOOL ShouldBeCalled;
  85. } ETMDATA, *PETMDATA;
  86. typedef struct {
  87. BOOL Initialized;
  88. PCTSTR VcmPath;
  89. PCTSTR Group;
  90. HANDLE LibHandle;
  91. PVCMINITIALIZE VcmInitialize;
  92. PVCMPARSE VcmParse;
  93. PVCMQUEUEENUMERATION VcmQueueEnumeration;
  94. PVCMQUEUEHIGHPRIORITYENUMERATION VcmQueueHighPriorityEnumeration;
  95. PVCMTERMINATE VcmTerminate;
  96. BOOL ShouldBeCalled;
  97. } VCMDATA, *PVCMDATA;
  98. typedef struct {
  99. BOOL Initialized;
  100. PCTSTR SgmPath;
  101. PCTSTR Group;
  102. HANDLE LibHandle;
  103. PSGMINITIALIZE SgmInitialize;
  104. PSGMPARSE SgmParse;
  105. PSGMQUEUEENUMERATION SgmQueueEnumeration;
  106. PSGMQUEUEHIGHPRIORITYENUMERATION SgmQueueHighPriorityEnumeration;
  107. PSGMTERMINATE SgmTerminate;
  108. BOOL ShouldBeCalled;
  109. } SGMDATA, *PSGMDATA;
  110. typedef struct {
  111. BOOL Initialized;
  112. PCTSTR SamPath;
  113. PCTSTR Group;
  114. HANDLE LibHandle;
  115. PSAMINITIALIZE SamInitialize;
  116. PSAMEXECUTE SamExecute;
  117. PSAMESTIMATEPROGRESSBAR SamEstimateProgressBar;
  118. PSAMTERMINATE SamTerminate;
  119. BOOL ShouldBeCalled;
  120. } SAMDATA, *PSAMDATA;
  121. typedef struct {
  122. BOOL Initialized;
  123. PCTSTR DgmPath;
  124. PCTSTR Group;
  125. HANDLE LibHandle;
  126. PDGMINITIALIZE DgmInitialize;
  127. PDGMQUEUEENUMERATION DgmQueueEnumeration;
  128. PDGMQUEUEHIGHPRIORITYENUMERATION DgmQueueHighPriorityEnumeration;
  129. PDGMTERMINATE DgmTerminate;
  130. BOOL ShouldBeCalled;
  131. } DGMDATA, *PDGMDATA;
  132. typedef struct {
  133. BOOL Initialized;
  134. PCTSTR DamPath;
  135. PCTSTR Group;
  136. HANDLE LibHandle;
  137. PDAMINITIALIZE DamInitialize;
  138. PDAMEXECUTE DamExecute;
  139. PDAMESTIMATEPROGRESSBAR DamEstimateProgressBar;
  140. PDAMTERMINATE DamTerminate;
  141. BOOL ShouldBeCalled;
  142. } DAMDATA, *PDAMDATA;
  143. typedef struct {
  144. BOOL Initialized;
  145. PCTSTR CsmPath;
  146. PCTSTR Group;
  147. HANDLE LibHandle;
  148. PCSMINITIALIZE CsmInitialize;
  149. PCSMEXECUTE CsmExecute;
  150. PCSMESTIMATEPROGRESSBAR CsmEstimateProgressBar;
  151. PCSMTERMINATE CsmTerminate;
  152. BOOL ShouldBeCalled;
  153. } CSMDATA, *PCSMDATA;
  154. typedef struct {
  155. BOOL Initialized;
  156. PCTSTR OpmPath;
  157. PCTSTR Group;
  158. HANDLE LibHandle;
  159. POPMINITIALIZE OpmInitialize;
  160. POPMTERMINATE OpmTerminate;
  161. BOOL ShouldBeCalled;
  162. } OPMDATA, *POPMDATA;
  163. typedef struct {
  164. BOOL Initialized;
  165. PCTSTR TransportPath;
  166. PCTSTR Group;
  167. HANDLE LibHandle;
  168. PTRANSPORTINITIALIZE TransportInitialize;
  169. PTRANSPORTTERMINATE TransportTerminate;
  170. PTRANSPORTQUERYCAPABILITIES TransportQueryCapabilities;
  171. PTRANSPORTSETSTORAGE TransportSetStorage;
  172. PTRANSPORTRESETSTORAGE TransportResetStorage;
  173. PTRANSPORTSAVESTATE TransportSaveState;
  174. PTRANSPORTRESUMESAVESTATE TransportResumeSaveState;
  175. PTRANSPORTBEGINAPPLY TransportBeginApply;
  176. PTRANSPORTRESUMEAPPLY TransportResumeApply;
  177. PTRANSPORTACQUIREOBJECT TransportAcquireObject;
  178. PTRANSPORTRELEASEOBJECT TransportReleaseObject;
  179. PTRANSPORTENDAPPLY TransportEndApply;
  180. PTRANSPORTESTIMATEPROGRESSBAR TransportEstimateProgressBar;
  181. BOOL ShouldBeCalled;
  182. } TRANSPORTDATA, *PTRANSPORTDATA;
  183. typedef struct {
  184. MIG_PLATFORMTYPEID Platform;
  185. ENVENTRY_TYPE EnvEntryType;
  186. PCTSTR EnvEntryGroup;
  187. PCTSTR EnvEntryName;
  188. UINT EnvEntryDataSize;
  189. PBYTE EnvEntryData;
  190. MEMDB_ENUM Handle;
  191. } ENV_ENTRY_ENUM, *PENV_ENTRY_ENUM;
  192. typedef struct {
  193. HANDLE FileHandle;
  194. HANDLE MapHandle;
  195. TCHAR TempFile [MAX_PATH];
  196. BOOL Moved;
  197. BOOL OkToMove;
  198. ULONG_PTR TransportArg;
  199. } ACQUIREHANDLE, *PACQUIREHANDLE;
  200. typedef struct {
  201. MIG_OBJECTTYPEID ObjectTypeId;
  202. PPARSEDPATTERNW PlainNodeParsedPattern;
  203. PPARSEDPATTERNW NodeParsedPattern;
  204. PPARSEDPATTERNW LeafParsedPattern;
  205. } DBENUM_ARGS, *PDBENUM_ARGS;
  206. typedef struct {
  207. PCTSTR UserName;
  208. PCTSTR DomainName;
  209. PCTSTR AccountName;
  210. PCTSTR UserProfileRoot;
  211. PCTSTR MapKey;
  212. PCTSTR UserHive;
  213. PCTSTR UserStringSid;
  214. PSID UserSid;
  215. PCTSTR DelayedOpJrn;
  216. HANDLE DelayedOpJrnHandle;
  217. // internal members
  218. PMHANDLE AllocPool;
  219. } TEMPORARYPROFILE, *PTEMPORARYPROFILE;
  220. typedef struct {
  221. PCTSTR UserName;
  222. PCTSTR UserDomain;
  223. PCTSTR UserStringSid;
  224. PCTSTR UserProfilePath;
  225. // internal members
  226. PMHANDLE AllocPool;
  227. } CURRENT_USER_DATA, *PCURRENT_USER_DATA;
  228. //
  229. // group registration enumeration
  230. //
  231. typedef struct {
  232. KEYHANDLE GroupOrItemId;
  233. BOOL ItemId;
  234. // private members
  235. MEMDB_ENUM EnumStruct;
  236. } GROUPREGISTRATION_ENUM, *PGROUPREGISTRATION_ENUM;
  237. typedef BOOL (GROUPITEM_CALLBACK_PROTOTYPE)(KEYHANDLE ItemId, BOOL FirstPass, ULONG_PTR Arg);
  238. typedef GROUPITEM_CALLBACK_PROTOTYPE * GROUPITEM_CALLBACK;
  239. typedef enum {
  240. RECURSE_NOT_NEEDED,
  241. RECURSE_SUCCESS,
  242. RECURSE_FAIL
  243. } RECURSERETURN;
  244. //
  245. // Restore callbacks
  246. //
  247. typedef struct _TAG_RESTORE_STRUCT {
  248. PMIG_RESTORECALLBACK RestoreCallback;
  249. //
  250. // Linkage.
  251. //
  252. struct _TAG_RESTORE_STRUCT * Next;
  253. } RESTORE_STRUCT, *PRESTORE_STRUCT;
  254. typedef struct {
  255. PRESTORE_STRUCT RestoreStruct;
  256. PMIG_RESTORECALLBACK RestoreCallback;
  257. } MIG_RESTORECALLBACK_ENUM, *PMIG_RESTORECALLBACK_ENUM;
  258. //
  259. // Object compare callbacks
  260. //
  261. typedef struct _TAG_COMPARE_STRUCT {
  262. MIG_OBJECTTYPEID ObjectTypeId;
  263. PMIG_COMPARECALLBACK CompareCallback;
  264. //
  265. // Linkage.
  266. //
  267. struct _TAG_COMPARE_STRUCT * Next;
  268. } COMPARE_STRUCT, *PCOMPARE_STRUCT;
  269. typedef struct {
  270. PCOMPARE_STRUCT CompareStruct;
  271. PMIG_COMPARECALLBACK CompareCallback;
  272. } MIG_COMPARECALLBACK_ENUM, *PMIG_COMPARECALLBACK_ENUM;
  273. //
  274. // Globals
  275. //
  276. extern MIG_OBJECTCOUNT g_TotalObjects;
  277. extern MIG_OBJECTCOUNT g_SourceObjects;
  278. extern MIG_OBJECTCOUNT g_DestinationObjects;
  279. extern PCTSTR g_CurrentGroup;
  280. extern HINF g_IsmInf;
  281. extern PMHANDLE g_IsmPool;
  282. extern PMHANDLE g_IsmUntrackedPool;
  283. extern UINT g_IsmCurrentPlatform;
  284. extern UINT g_IsmModulePlatformContext;
  285. extern MIG_ATTRIBUTEID g_PersistentAttributeId;
  286. extern PTRANSPORTDATA g_SelectedTransport;
  287. extern HANDLE g_ActivityEvent;
  288. extern PCTSTR g_JournalDirectory;
  289. extern HANDLE g_JournalHandle;
  290. extern BOOL g_RollbackMode;
  291. extern BOOL g_JournalUsed;
  292. extern HASHTABLE g_ModuleTable;
  293. extern HASHTABLE g_EtmTable;
  294. extern HASHTABLE g_VcmTable;
  295. extern HASHTABLE g_SgmTable;
  296. extern HASHTABLE g_SamTable;
  297. extern HASHTABLE g_DgmTable;
  298. extern HASHTABLE g_DamTable;
  299. extern HASHTABLE g_CsmTable;
  300. extern HASHTABLE g_OpmTable;
  301. extern PMIG_LOGCALLBACK g_LogCallback;
  302. extern HASHTABLE g_TransportTable;
  303. extern BOOL g_ExecutionInProgress;
  304. extern GROWLIST g_AcquireHookList;
  305. extern GROWLIST g_EnumHookList;
  306. extern PPROGRESSBARFN g_ProgressBarFn;
  307. extern MIG_PROGRESSPHASE g_CurrentPhase;
  308. #ifdef PRERELEASE
  309. // crash hooks
  310. extern DWORD g_CrashCountObjects;
  311. extern MIG_OBJECTTYPEID g_CrashNameTypeId;
  312. extern PCTSTR g_CrashNameObject;
  313. #endif
  314. //
  315. // Macro expansion list
  316. //
  317. // None
  318. //
  319. // Macro expansion definition
  320. //
  321. // None
  322. //
  323. // Private function prototypes
  324. //
  325. BOOL
  326. CheckCancel (
  327. VOID
  328. );
  329. MIG_OBJECTTYPEID
  330. FixObjectTypeId (
  331. IN MIG_OBJECTTYPEID ObjectTypeId
  332. );
  333. MIG_OBJECTTYPEID
  334. FixEnumerationObjectTypeId (
  335. IN MIG_OBJECTTYPEID ObjectTypeId
  336. );
  337. BOOL
  338. InitializeTypeMgr (
  339. VOID
  340. );
  341. VOID
  342. TerminateTypeMgr (
  343. VOID
  344. );
  345. BOOL
  346. InitializeEnv (
  347. VOID
  348. );
  349. VOID
  350. TerminateEnv (
  351. VOID
  352. );
  353. BOOL
  354. EnumFirstObjectOfType (
  355. OUT PMIG_TYPEOBJECTENUM EnumPtr,
  356. IN MIG_OBJECTTYPEID TypeId,
  357. IN PCTSTR Pattern,
  358. IN UINT MaxLevel
  359. );
  360. BOOL
  361. EnumNextObjectOfType (
  362. IN OUT PMIG_TYPEOBJECTENUM EnumPtr
  363. );
  364. VOID
  365. AbortObjectOfTypeEnum (
  366. IN OUT PMIG_TYPEOBJECTENUM EnumPtr
  367. );
  368. VOID
  369. AbortCurrentNodeEnum (
  370. IN OUT PMIG_TYPEOBJECTENUM EnumPtr
  371. );
  372. MIG_OBJECTTYPEID
  373. GetObjectTypeId (
  374. IN PCTSTR TypeName
  375. );
  376. PCTSTR
  377. GetObjectTypeName (
  378. IN MIG_OBJECTTYPEID TypeId
  379. );
  380. PCTSTR
  381. GetDecoratedObjectPathFromName (
  382. IN MIG_OBJECTTYPEID ObjectTypeId,
  383. IN PCTSTR ObjectName,
  384. IN BOOL CanContainPattern
  385. );
  386. BOOL
  387. InitializeFlowControl (
  388. VOID
  389. );
  390. VOID
  391. TerminateFlowControl (
  392. VOID
  393. );
  394. BOOL
  395. DoAllObjectEnumerations (
  396. MIG_PROGRESSSLICEID SliceId
  397. );
  398. UINT
  399. EstimateAllObjectEnumerations (
  400. MIG_PROGRESSSLICEID SliceId,
  401. BOOL PreEstimate
  402. );
  403. VOID
  404. AddTypeToGlobalEnumerationEnvironment (
  405. IN MIG_OBJECTTYPEID TypeId
  406. );
  407. BOOL
  408. PrepareEnumerationEnvironment (
  409. IN BOOL GlobalEnvironment
  410. );
  411. BOOL
  412. ClearEnumerationEnvironment (
  413. IN BOOL GlobalEnvironment
  414. );
  415. LONGLONG
  416. AppendProperty (
  417. PCMIG_BLOB Property
  418. );
  419. BOOL
  420. GetProperty (
  421. IN LONGLONG Offset,
  422. IN OUT PGROWBUFFER Buffer, OPTIONAL
  423. OUT PBYTE PreAllocatedBuffer, OPTIONAL
  424. OUT PUINT Size, OPTIONAL
  425. OUT PMIG_BLOBTYPE PropertyDataType OPTIONAL
  426. );
  427. BOOL
  428. CreatePropertyStruct (
  429. OUT PGROWBUFFER Buffer,
  430. OUT PMIG_BLOB PropertyStruct,
  431. IN LONGLONG Offset
  432. );
  433. BOOL
  434. IsObjectLocked (
  435. IN MIG_OBJECTID ObjectId
  436. );
  437. BOOL
  438. IsHandleLocked (
  439. IN MIG_OBJECTID ObjectId,
  440. IN KEYHANDLE Handle
  441. );
  442. BOOL
  443. TestLock (
  444. IN MIG_OBJECTID ObjectId,
  445. IN KEYHANDLE Handle
  446. );
  447. VOID
  448. LockHandle (
  449. IN MIG_OBJECTID ObjectId,
  450. IN KEYHANDLE Handle
  451. );
  452. PCTSTR
  453. GetObjectNameForDebugMsg (
  454. IN MIG_OBJECTID ObjectId
  455. );
  456. BOOL
  457. InitializeOperations (
  458. VOID
  459. );
  460. VOID
  461. TerminateOperations (
  462. VOID
  463. );
  464. BOOL
  465. IsValidCName (
  466. IN PCTSTR Name
  467. );
  468. BOOL
  469. IsValidCNameWithDots (
  470. IN PCTSTR Name
  471. );
  472. BOOL
  473. MarkGroupIds (
  474. IN PCTSTR MemDbKey
  475. );
  476. BOOL
  477. IsGroupId (
  478. IN KEYHANDLE Id
  479. );
  480. BOOL
  481. IsItemId (
  482. IN KEYHANDLE Id
  483. );
  484. VOID
  485. EngineError (
  486. VOID
  487. );
  488. BOOL
  489. ApplyOperationsOnObject (
  490. IN MIG_OBJECTTYPEID ObjectTypeId,
  491. IN MIG_OBJECTSTRINGHANDLE ObjectName,
  492. IN BOOL TreeFiltersOnly,
  493. IN BOOL NoRestoreObject,
  494. IN DWORD OperationPriority,
  495. IN PMIG_CONTENT ApplyInput, OPTIONAL
  496. OUT PMIG_FILTEROUTPUT FilterOutput,
  497. OUT PMIG_CONTENT ApplyOutput OPTIONAL
  498. );
  499. VOID
  500. FreeApplyOutput (
  501. IN PCMIG_CONTENT OriginalContent,
  502. IN PMIG_CONTENT FinalContent
  503. );
  504. VOID
  505. FreeFilterOutput (
  506. IN MIG_OBJECTSTRINGHANDLE OriginalString,
  507. IN PMIG_FILTEROUTPUT FilterOutput
  508. );
  509. KEYHANDLE
  510. GetGroupOfId (
  511. IN KEYHANDLE Handle
  512. );
  513. BOOL
  514. EnumFirstGroupRegistration (
  515. OUT PGROUPREGISTRATION_ENUM EnumPtr,
  516. IN KEYHANDLE GroupId
  517. );
  518. BOOL
  519. EnumNextGroupRegistration (
  520. IN OUT PGROUPREGISTRATION_ENUM EnumPtr
  521. );
  522. VOID
  523. AbortGroupRegistrationEnum (
  524. IN PGROUPREGISTRATION_ENUM EnumPtr
  525. );
  526. BOOL
  527. ValidateModuleName (
  528. IN PCTSTR ModuleName
  529. );
  530. RECURSERETURN
  531. RecurseForGroupItems (
  532. IN KEYHANDLE GroupId,
  533. IN GROUPITEM_CALLBACK Callback,
  534. IN ULONG_PTR Arg,
  535. IN BOOL ExecuteOnly,
  536. IN BOOL LogicalOrOnResults
  537. );
  538. BOOL
  539. InitializeProperties (
  540. IN MIG_PLATFORMTYPEID Platform,
  541. IN BOOL VcmMode
  542. );
  543. VOID
  544. TerminateProperties (
  545. IN MIG_PLATFORMTYPEID Platform
  546. );
  547. LONGLONG
  548. OffsetFromPropertyDataId (
  549. IN MIG_PROPERTYDATAID PropertyDataId
  550. );
  551. BOOL
  552. DbEnumFillStruct (
  553. IN MIG_OBJECTTYPEID ObjectTypeId,
  554. IN PCTSTR Pattern,
  555. OUT PDBENUM_ARGS Args
  556. );
  557. VOID
  558. DbEnumFreeStruct (
  559. IN PDBENUM_ARGS Args
  560. );
  561. BOOL
  562. DbEnumFind (
  563. IN PCWSTR KeySegment
  564. );
  565. BOOL
  566. DbEnumMatch (
  567. IN PCVOID InboundArgs,
  568. IN PCWSTR KeySegment
  569. );
  570. BOOL
  571. DbEnumFirst (
  572. IN MIG_OBJECTTYPEID ObjectTypeId,
  573. OUT PMEMDB_ENUM EnumPtr,
  574. IN PCTSTR PatternString,
  575. OUT PDBENUM_ARGS ArgsStruct
  576. );
  577. VOID
  578. EnvInvalidateCallbacks (
  579. VOID
  580. );
  581. BOOL
  582. EnvSaveEnvironment (
  583. IN OUT PGROWLIST GrowList
  584. );
  585. BOOL
  586. EnvRestoreEnvironment (
  587. IN PGROWLIST GrowList
  588. );
  589. PTSTR
  590. GetFirstSeg (
  591. IN PCTSTR SrcFileName
  592. );
  593. MIG_OBJECTID
  594. GetObjectIdForModification (
  595. IN MIG_OBJECTTYPEID ObjectTypeId,
  596. IN ENCODEDSTRHANDLE EncodedObjectName
  597. );
  598. BOOL
  599. RestoreObject (
  600. IN MIG_OBJECTTYPEID ObjectTypeId,
  601. IN ENCODEDSTRHANDLE ObjectName,
  602. OUT MIG_COMPARERESULT *Compare, OPTIONAL
  603. IN DWORD OperationPriority,
  604. OUT PBOOL DeleteFailed
  605. );
  606. BOOL
  607. RegisterInternalAttributes (
  608. VOID
  609. );
  610. BOOL
  611. EnumFirstRestoreCallback (
  612. OUT PMIG_RESTORECALLBACK_ENUM RestoreCallbackEnum
  613. );
  614. BOOL
  615. EnumNextRestoreCallback (
  616. OUT PMIG_RESTORECALLBACK_ENUM RestoreCallbackEnum
  617. );
  618. BOOL
  619. ShouldObjectBeRestored (
  620. IN MIG_OBJECTTYPEID ObjectTypeId,
  621. IN MIG_OBJECTID ObjectId,
  622. IN MIG_OBJECTSTRINGHANDLE ObjectName
  623. );
  624. BOOL
  625. EnumFirstCompareCallback (
  626. OUT PMIG_COMPARECALLBACK_ENUM CompareCallbackEnum
  627. );
  628. BOOL
  629. EnumNextCompareCallback (
  630. OUT PMIG_COMPARECALLBACK_ENUM CompareCallbackEnum
  631. );
  632. VOID
  633. InitRegistryType (
  634. VOID
  635. );
  636. VOID
  637. DoneRegistryType (
  638. VOID
  639. );
  640. VOID
  641. InitIniType (
  642. VOID
  643. );
  644. VOID
  645. DoneIniType (
  646. VOID
  647. );
  648. VOID
  649. InitFileType (
  650. VOID
  651. );
  652. VOID
  653. DoneFileType (
  654. VOID
  655. );
  656. VOID
  657. InitDataType (
  658. VOID
  659. );
  660. VOID
  661. DoneDataType (
  662. VOID
  663. );
  664. BOOL
  665. DataTypeAddObject (
  666. IN MIG_OBJECTSTRINGHANDLE ObjectName,
  667. IN PCTSTR ObjectLocation,
  668. IN BOOL MakePersistent
  669. );
  670. BOOL
  671. CanObjectTypeBeRestored (
  672. IN MIG_OBJECTTYPEID ObjectTypeId
  673. );
  674. BOOL
  675. CanObjectTypeBeModified (
  676. IN MIG_OBJECTTYPEID ObjectTypeId
  677. );
  678. HASHTABLE
  679. GetTypeExclusionTable (
  680. IN MIG_OBJECTTYPEID ObjectTypeId
  681. );
  682. BOOL
  683. EnumFirstPhysicalObject (
  684. OUT PMIG_OBJECT_ENUM ObjectEnum,
  685. IN MIG_OBJECTTYPEID ObjectTypeId,
  686. IN MIG_OBJECTSTRINGHANDLE ObjectPattern
  687. );
  688. BOOL
  689. EnumNextPhysicalObject (
  690. IN OUT PMIG_OBJECT_ENUM ObjectEnum
  691. );
  692. VOID
  693. AbortPhysicalObjectEnum (
  694. IN PMIG_OBJECT_ENUM ObjectEnum
  695. );
  696. BOOL
  697. IncrementTotalObjectCount (
  698. IN MIG_OBJECTTYPEID ObjectTypeId
  699. );
  700. BOOL
  701. IncrementPersistentObjectCount (
  702. IN MIG_OBJECTTYPEID ObjectTypeId
  703. );
  704. BOOL
  705. DecrementPersistentObjectCount (
  706. IN MIG_OBJECTTYPEID ObjectTypeId
  707. );
  708. BOOL
  709. IncrementApplyObjectCount (
  710. IN MIG_OBJECTTYPEID ObjectTypeId
  711. );
  712. BOOL
  713. DecrementApplyObjectCount (
  714. IN MIG_OBJECTTYPEID ObjectTypeId
  715. );
  716. PMIG_OBJECTCOUNT
  717. GetTypeObjectsStatistics (
  718. IN MIG_OBJECTTYPEID ObjectTypeId
  719. );
  720. BOOL
  721. SavePerObjectStatistics (
  722. VOID
  723. );
  724. BOOL
  725. LoadPerObjectStatistics (
  726. VOID
  727. );
  728. BOOL
  729. EnvEnumerateFirstEntry (
  730. OUT PENV_ENTRY_ENUM EnvEntryEnum,
  731. IN MIG_PLATFORMTYPEID Platform,
  732. IN PCTSTR Pattern
  733. );
  734. BOOL
  735. EnvEnumerateNextEntry (
  736. IN OUT PENV_ENTRY_ENUM EnvEntryEnum
  737. );
  738. VOID
  739. AbortEnvEnumerateEntry (
  740. IN OUT PENV_ENTRY_ENUM EnvEntryEnum
  741. );
  742. PTEMPORARYPROFILE
  743. OpenTemporaryProfile (
  744. IN PCTSTR UserName,
  745. IN PCTSTR Domain
  746. );
  747. BOOL
  748. SelectTemporaryProfile (
  749. IN PTEMPORARYPROFILE Profile
  750. );
  751. BOOL
  752. CloseTemporaryProfile (
  753. IN PTEMPORARYPROFILE Profile,
  754. IN BOOL MakeProfilePermanent
  755. );
  756. BOOL
  757. MapUserProfile (
  758. IN PCTSTR UserStringSid,
  759. IN PCTSTR UserProfilePath
  760. );
  761. BOOL
  762. UnmapUserProfile (
  763. IN PCTSTR UserStringSid
  764. );
  765. BOOL
  766. DeleteUserProfile (
  767. IN PCTSTR UserStringSid,
  768. IN PCTSTR UserProfilePath
  769. );
  770. PCURRENT_USER_DATA
  771. GetCurrentUserData (
  772. VOID
  773. );
  774. VOID
  775. FreeCurrentUserData (
  776. IN PCURRENT_USER_DATA CurrentUserData
  777. );
  778. BOOL
  779. ExecuteDelayedOperations (
  780. IN BOOL CleanupOnly
  781. );
  782. //
  783. // modules.c
  784. //
  785. BOOL
  786. InitializeVcmModules (
  787. IN PVOID Reserved
  788. );
  789. BOOL
  790. InitializeModules (
  791. IN MIG_PLATFORMTYPEID Platform,
  792. IN PVOID Reserved
  793. );
  794. BOOL
  795. BroadcastUserCreation (
  796. IN PTEMPORARYPROFILE UserProfile
  797. );
  798. VOID
  799. TerminateModules (
  800. VOID
  801. );
  802. VOID
  803. TerminateProcessWideModules (
  804. VOID
  805. );
  806. BOOL
  807. ExecutePhysicalAcquireCallbacks (
  808. IN MIG_OBJECTTYPEID ObjectTypeId,
  809. IN MIG_OBJECTSTRINGHANDLE ObjectName,
  810. IN PMIG_CONTENT Content,
  811. IN MIG_CONTENTTYPE ContentType,
  812. IN UINT MemoryContentLimit,
  813. OUT PMIG_CONTENT *NewContent
  814. );
  815. BOOL
  816. FreeViaAcquirePhysicalCallback (
  817. IN PMIG_CONTENT Content
  818. );
  819. BOOL
  820. ExecutePhysicalEnumCheckCallbacks (
  821. IN PMIG_TYPEOBJECTENUM ObjectEnum
  822. );
  823. BOOL
  824. ExecutePhysicalEnumAddCallbacks (
  825. IN OUT PMIG_TYPEOBJECTENUM ObjectEnum,
  826. IN MIG_OBJECTSTRINGHANDLE Pattern,
  827. IN MIG_PARSEDPATTERN ParsedPattern,
  828. IN OUT PUINT CurrentCallback
  829. );
  830. VOID
  831. AbortPhysicalEnumCallback (
  832. IN PMIG_TYPEOBJECTENUM ObjectEnum, ZEROED
  833. IN UINT CurrentCallback
  834. );
  835. #ifdef PRERELEASE
  836. VOID
  837. LoadCrashHooks (
  838. VOID
  839. );
  840. #endif
  841. //
  842. // ANSI/UNICODE Macros
  843. //
  844. // None