forked from terrisWayne/objidlib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
objidlib.h
60 lines (57 loc) · 2.03 KB
/
objidlib.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/** @file objidlib.h
* @brief A header file of a library for
* working with NTFS Object Idenitifers
* @author amdf
* @version 0.2
* @date September 2011
*/
#ifdef OBJIDLIB_EXPORTS
//! Dll export definition
#define OBJIDLIB_API extern "C" __declspec(dllexport)
#else
#define OBJIDLIB_API extern "C" __declspec(dllimport)
#endif
#ifndef OBJECTID_ATTRIBUTE
//! Object id file stream
typedef struct
{
/** The identifier that uniquely identifies the file or directory
* within the volume on which it resides. This is the portion of
* the object id that is indexed.
*/
GUID ObjectId;
union
{
struct
{
/** The identifier of the volume on which the object resided
* when the object identifier was created, or zero if the
* volume had no object identifier at that time. After copy
* operations, move operations, or other file operations,
* this may not be the same as the object identifier of the
* volume on which the object presently resides.
*/
GUID BirthVolumeId;
/** The object identifier of the object at the time it was created.
* After copy operations, move operations, or other file operations,
* this may not be the same as the ObjectId member at present.
*/
GUID BirthObjectId;
/**
* Reserved; should be zero.
*/
GUID DomainId;
};
/** This portion of the object id is not indexed,
* it's just some metadata for the user's benefit.
*/
UCHAR ExtendedInfo[48];
};
} OBJECTID_ATTRIBUTE, *POBJECTID_ATTRIBUTE;
#endif
OBJIDLIB_API BOOL CreateObjectId(IN LPCWSTR sFileName, OUT POBJECTID_ATTRIBUTE pObjId);
OBJIDLIB_API BOOL GetObjectId(IN LPCWSTR sFileName, OUT POBJECTID_ATTRIBUTE pObjId);
OBJIDLIB_API BOOL ObjectIdExists(IN LPCWSTR sFileName);
OBJIDLIB_API BOOL DeleteObjectId(IN LPCWSTR sFileName);
OBJIDLIB_API BOOL SetObjectId(IN LPCWSTR sFileName, IN POBJECTID_ATTRIBUTE pObjId);
OBJIDLIB_API BOOL SetObjectIdExt(IN LPCWSTR sFileName, IN POBJECTID_ATTRIBUTE pObjId);