00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
#ifndef _PROPAPI_H_
00028
#define _PROPAPI_H_
00029
00030
#ifdef __cplusplus
00031
extern "C" {
00032
#endif
00033
00034
00035
00036
00037
00038
00039
typedef UINT (WINAPI FNGETACP)(
VOID);
00040
00041
typedef int (WINAPI FNMULTIBYTETOWIDECHAR)(
00042 IN
UINT CodePage,
00043 IN
DWORD dwFlags,
00044 IN LPCSTR
lpMultiByteStr,
00045 IN
int cchMultiByte,
00046 OUT LPWSTR
lpWideCharStr,
00047 IN
int cchWideChar);
00048
00049
typedef int (WINAPI FNWIDECHARTOMULTIBYTE)(
00050 IN
UINT CodePage,
00051 IN
DWORD dwFlags,
00052 IN LPCWSTR
lpWideCharStr,
00053 IN
int cchWideChar,
00054 OUT LPSTR
lpMultiByteStr,
00055 IN
int cchMultiByte,
00056 IN LPCSTR
lpDefaultChar,
00057 IN LPBOOL
lpUsedDefaultChar);
00058
00059 typedef BSTR
FNSYSALLOCSTRING(
00060 OLECHAR FAR* pwsz);
00061
00062 typedef VOID FNSYSFREESTRING(
00063 BSTR pwsz);
00064
00065
00066
00067
00068
00069
00070
00071 typedef struct _UNICODECALLOUTS
00072 {
00073 FNGETACP *
pfnGetACP;
00074 FNMULTIBYTETOWIDECHAR *
pfnMultiByteToWideChar;
00075 FNWIDECHARTOMULTIBYTE *
pfnWideCharToMultiByte;
00076 FNSYSALLOCSTRING *
pfnSysAllocString;
00077 FNSYSFREESTRING *
pfnSysFreeString;
00078 }
UNICODECALLOUTS;
00079
00080
00081
00082
00083
00084
00085
00086 STDAPI_(BSTR)
00087 PropSysAllocString(OLECHAR FAR* pwsz);
00088
00089 STDAPI_(VOID)
00090 PropSysFreeString(BSTR bstr);
00091
00092 #define WIN32_UNICODECALLOUTS \
00093 GetACP, \
00094 MultiByteToWideChar, \
00095 WideCharToMultiByte, \
00096 PropSysAllocString, \
00097 PropSysFreeString
00098
00099
00100
00101 #if defined(WINNT) && !defined(IPROPERTY_DLL)
00102
00103
00104 # define PROPSYSAPI NTSYSAPI
00105 # define PROPAPI NTAPI
00106
00107
00108 # define PropFreeHeap(h, z, p) RtlFreeHeap(h, z, p)
00109
00110
00111 # define PROPASSERT ASSERT
00112 # define PROPASSERTMSG ASSERTMSG
00113
00114
00115 # define PROPGENPROPERTYNAME(s,n) swprintf ((s), L"prop%lu", (n))
00116
00117
00118 # define PropSprintfA sprintf
00119 # define PropVsprintfA vsprintf
00120
00121
00122
00123
00124 #else
00125
00126
00127 # define PROPSYSAPI
00128 # define PROPAPI
00129
00130
00131 # define PropFreeHeap(h, z, p) CoTaskMemFree(p)
00132
00133
00134 # if DBG==1
00135 # ifdef _MAC_NODOC
00136 # define PROPASSERT(f) {
if (!(f)) FnAssert(#f,
NULL, __FILE__, __LINE__); }
00137
# define PROPASSERTMSG(szReason, f) { if (!(f)) FnAssert(#f, szReason, __FILE__, __LINE__); }
00138
# else
00139
# define PROPASSERT(f) Win4Assert((f))
00140
# define PROPASSERTMSG(szReason, f) Win4Assert( (szReason && FALSE) || (f))
00141
# endif
00142
# else
00143 # define PROPASSERT(f)
00144 # define PROPASSERTMSG(szReason, f)
00145
# endif // #if DBG==1
00146
00147
00148 # define PROPGENPROPERTYNAME(s,n) \
00149
{ \
00150
memcpy ((s), OLESTR("prop"), sizeof (OLESTR("prop"))); \
00151
ULTOO ((n), &(s)[sizeof("prop") - 1], 10); \
00152
}
00153
00154
00155
# ifdef IPROPERTY_DLL
00156
# define PropSprintfA sprintf
00157
# define PropVsprintfA vsprintf
00158
# else
00159 # define PropSprintfA wsprintfA
00160 # define PropVsprintfA wvsprintfA
00161
# endif // #ifdef _MAC_NODOC
00162
00163
#endif // #if defined(WINNT) && !defined(IPROPERTY_DLL) ... #else
00164
00165
00166
#ifdef IPROPERTY_DLL
00167
#define MAX_ULONG ((ULONG) -1)
00168
#endif
00169
00170
00171 #define WC_PROPSET0 ((WCHAR) 0x0005)
00172 #define OC_PROPSET0 ((OLECHAR) 0x0005)
00173
00174 #define CBIT_BYTE 8
00175 #define CBIT_GUID (CBIT_BYTE * sizeof(GUID))
00176 #define CBIT_CHARMASK 5
00177
00178
00179 #define CCH_PROPSET (1 + (CBIT_GUID + CBIT_CHARMASK-1)/CBIT_CHARMASK)
00180 #define CCH_PROPSETSZ (CCH_PROPSET + 1) // allow null
00181 #define CCH_PROPSETCOLONSZ (1 + CCH_PROPSET + 1) // allow colon and null
00182
00183
00184
00185
00186 #define CCH_MAXPROPNAME 255 // Matches Shell & Office
00187 #define CCH_MAXPROPNAMESZ (CCH_MAXPROPNAME + 1) // allow null
00188 #define CWC_MAXPROPNAME CCH_MAXPROPNAME
00189 #define CWC_MAXPROPNAMESZ CCH_MAXPROPNAMESZ
00190
00191 #define MAX_DOCFILE_ENTRY_NAME 31
00192
00193
00194
00195
00196
00197 typedef VOID *
NTPROP;
00198 typedef VOID *
NTMAPPEDSTREAM;
00199 typedef VOID *
NTMEMORYALLOCATOR;
00200
00201
00202
VOID PROPSYSAPI PROPAPI
00203
RtlSetUnicodeCallouts(
00204 IN
UNICODECALLOUTS *pUnicodeCallouts);
00205
00206 ULONG
PROPSYSAPI PROPAPI
00207
RtlGuidToPropertySetName(
00208 IN GUID
const *pguid,
00209 OUT OLECHAR aocname[]);
00210
00211
NTSTATUS PROPSYSAPI PROPAPI
00212
RtlPropertySetNameToGuid(
00213 IN ULONG cwcname,
00214 IN OLECHAR
const aocname[],
00215 OUT GUID *pguid);
00216
00217
VOID
00218
PrSetUnicodeCallouts(
00219 IN
UNICODECALLOUTS *pUnicodeCallouts);
00220
00221 ULONG
00222
PrGuidToPropertySetName(
00223 IN GUID
const *pguid,
00224 OUT OLECHAR aocname[]);
00225
00226
NTSTATUS
00227
PrPropertySetNameToGuid(
00228 IN ULONG cwcname,
00229 IN OLECHAR
const aocname[],
00230 OUT GUID *pguid);
00231
00232
00233
00234
00235 #define CREATEPROP_READ 0x0000 // request read access (must exist)
00236 #define CREATEPROP_WRITE 0x0001 // request write access (must exist)
00237 #define CREATEPROP_CREATE 0x0002 // create (overwrite if exists)
00238 #define CREATEPROP_CREATEIF 0x0003 // create (open existing if exists)
00239 #define CREATEPROP_DELETE 0x0004 // delete
00240 #define CREATEPROP_MODEMASK 0x000f // open mode mask
00241
00242 #define CREATEPROP_NONSIMPLE 0x0010 // Is non-simple propset (in a storage)
00243
00244
00245
00246
00247 #define CMS_READONLY 0x00000000 // Opened for read-only
00248 #define CMS_WRITE 0x00000001 // Opened for write access
00249 #define CMS_TRANSACTED 0x00000002 // Is transacted
00250
00251
00252
NTSTATUS PROPSYSAPI PROPAPI
00253
RtlCreatePropertySet(
00254 IN NTMAPPEDSTREAM ms,
00255 IN USHORT Flags,
00256 OPTIONAL IN GUID
const *pguid,
00257 OPTIONAL IN GUID
const *pclsid,
00258 IN NTMEMORYALLOCATOR ma,
00259 IN ULONG LocaleId,
00260 OPTIONAL OUT ULONG *pOSVersion,
00261 IN OUT USHORT *pCodePage,
00262
00263 OUT NTPROP *pnp);
00264
00265
NTSTATUS PROPSYSAPI PROPAPI
00266
RtlClosePropertySet(
00267 IN NTPROP np);
00268
00269
NTSTATUS
00270
PrCreatePropertySet(
00271 IN NTMAPPEDSTREAM ms,
00272 IN USHORT Flags,
00273 OPTIONAL IN GUID
const *pguid,
00274 OPTIONAL IN GUID
const *pclsid,
00275 IN NTMEMORYALLOCATOR ma,
00276 IN ULONG LocaleId,
00277 OPTIONAL OUT ULONG *pOSVersion,
00278 IN OUT USHORT *pCodePage,
00279
00280 OUT NTPROP *pnp);
00281
00282
NTSTATUS
00283
PrClosePropertySet(
00284 IN NTPROP np);
00285
00286
00287
00288 #define CBSTM_UNKNOWN ((ULONG) -1)
00289
NTSTATUS PROPSYSAPI PROPAPI
00290
RtlOnMappedStreamEvent(
00291 IN VOID *pv,
00292 IN VOID *pbuf,
00293 IN ULONG cbstm );
00294
NTSTATUS
00295
PrOnMappedStreamEvent(
00296 IN VOID *pv,
00297 IN VOID *pbuf,
00298 IN ULONG cbstm );
00299
00300
NTSTATUS PROPSYSAPI PROPAPI
00301
RtlFlushPropertySet(
00302 IN NTPROP np);
00303
NTSTATUS
00304
PrFlushPropertySet(
00305 IN NTPROP np);
00306
00307 typedef struct _INDIRECTPROPERTY
00308 {
00309 ULONG
Index;
00310 LPOLESTR
poszName;
00311 }
INDIRECTPROPERTY;
00312
00313
NTSTATUS PROPSYSAPI PROPAPI
00314
RtlSetProperties(
00315 IN NTPROP np,
00316 IN ULONG cprop,
00317 IN PROPID pidNameFirst,
00318 IN PROPSPEC
const aprs[],
00319 OPTIONAL OUT PROPID apid[],
00320 OPTIONAL OUT
INDIRECTPROPERTY **ppip,
00321
00322
00323 OPTIONAL IN PROPVARIANT
const avar[]);
00324
NTSTATUS
00325
PrSetProperties(
00326 IN NTPROP np,
00327 IN ULONG cprop,
00328 IN PROPID pidNameFirst,
00329 IN PROPSPEC
const aprs[],
00330 OPTIONAL OUT PROPID apid[],
00331 OPTIONAL OUT
INDIRECTPROPERTY **ppip,
00332
00333
00334 OPTIONAL IN PROPVARIANT
const avar[]);
00335
00336
NTSTATUS PROPSYSAPI PROPAPI
00337
RtlQueryProperties(
00338 IN NTPROP np,
00339 IN ULONG cprop,
00340 IN PROPSPEC
const aprs[],
00341 OPTIONAL OUT PROPID apid[],
00342 OPTIONAL OUT
INDIRECTPROPERTY **ppip,
00343
00344
00345 IN OUT PROPVARIANT *avar,
00346
00347 OUT ULONG *pcpropFound);
00348
NTSTATUS
00349
PrQueryProperties(
00350 IN NTPROP np,
00351 IN ULONG cprop,
00352 IN PROPSPEC
const aprs[],
00353 OPTIONAL OUT PROPID apid[],
00354 OPTIONAL OUT
INDIRECTPROPERTY **ppip,
00355
00356
00357 IN OUT PROPVARIANT *avar,
00358
00359 OUT ULONG *pcpropFound);
00360
00361
00362
00363 #define ENUMPROP_NONAMES 0x00000001 // return property IDs only
00364
00365
NTSTATUS PROPSYSAPI PROPAPI
00366
RtlEnumerateProperties(
00367 IN NTPROP np,
00368 IN ULONG Flags,
00369 IN OUT ULONG *pkey,
00370 IN OUT ULONG *pcprop,
00371 OPTIONAL OUT PROPSPEC aprs[],
00372
00373 OPTIONAL OUT STATPROPSTG asps[]);
00374
00375
00376
00377
NTSTATUS PROPSYSAPI PROPAPI
00378
RtlQueryPropertyNames(
00379 IN NTPROP np,
00380 IN ULONG cprop,
00381 IN PROPID
const *apid,
00382 OUT OLECHAR *aposz[]
00383 );
00384
00385
NTSTATUS PROPSYSAPI PROPAPI
00386
RtlSetPropertyNames(
00387 IN NTPROP np,
00388 IN ULONG cprop,
00389 IN PROPID
const *apid,
00390 IN OLECHAR
const *
const aposz[]
00391 );
00392
00393
NTSTATUS PROPSYSAPI PROPAPI
00394
RtlSetPropertySetClassId(
00395 IN NTPROP np,
00396 IN GUID
const *pclsid
00397 );
00398
00399
NTSTATUS PROPSYSAPI PROPAPI
00400
RtlQueryPropertySet(
00401 IN NTPROP np,
00402 OUT STATPROPSETSTG *pspss
00403 );
00404
00405
NTSTATUS PROPSYSAPI PROPAPI
00406
RtlEnumeratePropertySets(
00407 IN HANDLE hstg,
00408 IN BOOLEAN fRestart,
00409 IN OUT ULONG *pcspss,
00410 IN OUT GUID *pkey,
00411 OUT STATPROPSETSTG *pspss
00412 );
00413
00414
00415
00416
00417
00418
NTSTATUS
00419
PrEnumerateProperties(
00420 IN NTPROP np,
00421 IN ULONG Flags,
00422 IN OUT ULONG *pkey,
00423 IN OUT ULONG *pcprop,
00424 OPTIONAL OUT PROPSPEC aprs[],
00425
00426 OPTIONAL OUT STATPROPSTG asps[]);
00427
00428
00429
00430
NTSTATUS
00431
PrQueryPropertyNames(
00432 IN NTPROP np,
00433 IN ULONG cprop,
00434 IN PROPID
const *apid,
00435 OUT OLECHAR *aposz[]
00436 );
00437
00438
NTSTATUS
00439
PrSetPropertyNames(
00440 IN NTPROP np,
00441 IN ULONG cprop,
00442 IN PROPID
const *apid,
00443 IN OLECHAR
const *
const aposz[]
00444 );
00445
00446
NTSTATUS
00447
PrSetPropertySetClassId(
00448 IN NTPROP np,
00449 IN GUID
const *pclsid
00450 );
00451
00452
NTSTATUS
00453
PrQueryPropertySet(
00454 IN NTPROP np,
00455 OUT STATPROPSETSTG *pspss
00456 );
00457
00458
NTSTATUS
00459
PrEnumeratePropertySets(
00460 IN HANDLE hstg,
00461 IN BOOLEAN fRestart,
00462 IN OUT ULONG *pcspss,
00463 IN OUT GUID *pkey,
00464 OUT STATPROPSETSTG *pspss
00465 );
00466
00467
00468
00469
#ifdef __cplusplus
00470
}
00471
#endif
00472
00473
#endif // ifndef _PROPAPI_H_