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.

259 lines
8.6 KiB

  1. /*+-------------------------------------------------------------------------
  2. *
  3. * Microsoft Windows
  4. * Copyright (C) Microsoft Corporation, 1992 - 1996.
  5. *
  6. * File: propapi.h
  7. *
  8. * Contents: Definitions of Nt property api.
  9. *
  10. *--------------------------------------------------------------------------*/
  11. #ifndef _PROPAPI_H_
  12. #define _PROPAPI_H_
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. /**/
  17. /* typedef the function prototypes necessary*/
  18. /* for the UNICODECALLOUTS structure.*/
  19. /**/
  20. typedef UINT (WINAPI FNGETACP)(VOID);
  21. typedef int (WINAPI FNMULTIBYTETOWIDECHAR)(
  22. IN UINT CodePage,
  23. IN DWORD dwFlags,
  24. IN LPCSTR lpMultiByteStr,
  25. IN int cchMultiByte,
  26. OUT LPWSTR lpWideCharStr,
  27. IN int cchWideChar);
  28. typedef int (WINAPI FNWIDECHARTOMULTIBYTE)(
  29. IN UINT CodePage,
  30. IN DWORD dwFlags,
  31. IN LPCWSTR lpWideCharStr,
  32. IN int cchWideChar,
  33. OUT LPSTR lpMultiByteStr,
  34. IN int cchMultiByte,
  35. IN LPCSTR lpDefaultChar,
  36. IN LPBOOL lpUsedDefaultChar);
  37. typedef STDAPI_(BSTR) FNSYSALLOCSTRING(
  38. OLECHAR FAR* pwsz);
  39. typedef STDAPI_(VOID) FNSYSFREESTRING(
  40. BSTR pwsz);
  41. /**/
  42. /* The UNICODECALLOUTS structure holds function*/
  43. /* pointers for routines needed by the property*/
  44. /* set routines in NTDLL.*/
  45. /**/
  46. typedef struct _UNICODECALLOUTS
  47. {
  48. FNGETACP *pfnGetACP;
  49. FNMULTIBYTETOWIDECHAR *pfnMultiByteToWideChar;
  50. FNWIDECHARTOMULTIBYTE *pfnWideCharToMultiByte;
  51. FNSYSALLOCSTRING *pfnSysAllocString;
  52. FNSYSFREESTRING *pfnSysFreeString;
  53. } UNICODECALLOUTS;
  54. /**/
  55. /* Define the default UNICODECALLOUTS*/
  56. /* values.*/
  57. /**/
  58. #define WIN32_UNICODECALLOUTS \
  59. GetACP, \
  60. MultiByteToWideChar, \
  61. WideCharToMultiByte, \
  62. SysAllocString, \
  63. SysFreeString
  64. # define PROPSYSAPI
  65. # define PROPAPI
  66. # define PropFreeHeap(h, z, p) CoTaskMemFree(p)
  67. # define PROPASSERT assert
  68. #define PROPASSERTMSG(szReason, f) assert( (szReason && FALSE) || (f))
  69. # define PropSprintfA wsprintfA
  70. # define PropVsprintfA wvsprintfA
  71. #define WC_PROPSET0 ((WCHAR) 0x0005)
  72. #define OC_PROPSET0 ((OLECHAR) 0x0005)
  73. #define CBIT_BYTE 8
  74. #define CBIT_GUID (CBIT_BYTE * sizeof(GUID))
  75. #define CBIT_CHARMASK 5
  76. /* Allow for OC_PROPSET0 and a GUID mapped to a 32 character alphabet */
  77. #define CCH_PROPSET (1 + (CBIT_GUID + CBIT_CHARMASK-1)/CBIT_CHARMASK)
  78. #define CCH_PROPSETSZ (CHC_PROPSET + 1) /* allow null*/
  79. #define CCH_PROPSETCOLONSZ (1 + CHC_PROPSET + 1) /* allow colon and null*/
  80. /* Define the max property name in units of characters
  81. (and synonomously in wchars). */
  82. #define CCH_MAXPROPNAME 255 /* Matches Shell &
  83. Office */
  84. #define CCH_MAXPROPNAMESZ (CWC_MAXPROPNAME + 1) /* allow null */
  85. #define CWC_MAXPROPNAME CCH_MAXPROPNAME
  86. #define CWC_MAXPROPNAMESZ CCH_MAXPROPNAMESZ
  87. /*+--------------------------------------------------------------------------*/
  88. /* Property Access APIs: */
  89. /*---------------------------------------------------------------------------*/
  90. typedef VOID *NTPROP;
  91. typedef VOID *NTMAPPEDSTREAM;
  92. typedef VOID *NTMEMORYALLOCATOR;
  93. VOID PROPSYSAPI PROPAPI
  94. RtlSetUnicodeCallouts(
  95. IN UNICODECALLOUTS *pUnicodeCallouts);
  96. ULONG PROPSYSAPI PROPAPI
  97. RtlGuidToPropertySetName(
  98. IN GUID const *pguid,
  99. OUT OLECHAR aocname[]);
  100. NTSTATUS PROPSYSAPI PROPAPI
  101. RtlPropertySetNameToGuid(
  102. IN ULONG cwcname,
  103. IN OLECHAR const aocname[],
  104. OUT GUID *pguid);
  105. /* RtlCreatePropertySet Flags:*/
  106. #define CREATEPROP_READ 0x0000 /* request read access (must exist)*/
  107. #define CREATEPROP_WRITE 0x0001 /* request write access (must exist)*/
  108. #define CREATEPROP_CREATE 0x0002 /* create (overwrite if exists)*/
  109. #define CREATEPROP_CREATEIF 0x0003 /* create (open existing if exists)*/
  110. #define CREATEPROP_DELETE 0x0004 /* delete*/
  111. #define CREATEPROP_MODEMASK 0x000f /* open mode mask*/
  112. #define CREATEPROP_NONSIMPLE 0x0010 /* Is non-simple propset (in a storage)*/
  113. /* RtlCreateMappedStream Flags:*/
  114. #define CMS_READONLY 0x00000000 /* Opened for read-only*/
  115. #define CMS_WRITE 0x00000001 /* Opened for write access*/
  116. #define CMS_TRANSACTED 0x00000002 /* Is transacted*/
  117. NTSTATUS PROPSYSAPI PROPAPI
  118. RtlCreatePropertySet(
  119. IN NTMAPPEDSTREAM ms, /* Nt mapped stream*/
  120. IN USHORT Flags, /* NONSIMPLE|*1* of READ/WRITE/CREATE/CREATEIF/DELETE*/
  121. OPTIONAL IN GUID const *pguid, /* property set guid (create only)*/
  122. OPTIONAL IN GUID const *pclsid,/* CLASSID of propset code (create only)*/
  123. IN NTMEMORYALLOCATOR ma, /* memory allocator of caller*/
  124. IN ULONG LocaleId, /* Locale Id (create only)*/
  125. OPTIONAL OUT ULONG *pOSVersion,/* OS Version field in header.*/
  126. IN OUT USHORT *pCodePage, /* IN: CodePage of property set (create only)*/
  127. /* OUT: CodePage of property set (always)*/
  128. OUT NTPROP *pnp); /* Nt property set context*/
  129. NTSTATUS PROPSYSAPI PROPAPI
  130. RtlClosePropertySet(
  131. IN NTPROP np); /* property set context*/
  132. #define CBSTM_UNKNOWN ((ULONG) -1)
  133. NTSTATUS PROPSYSAPI PROPAPI
  134. RtlOnMappedStreamEvent(
  135. IN VOID *pv, /* property set context */
  136. IN VOID *pbuf, /* property set buffer */
  137. IN ULONG cbstm ); /* size of underlying stream or CBSTM_UNKNOWN */
  138. NTSTATUS PROPSYSAPI PROPAPI
  139. RtlFlushPropertySet(
  140. IN NTPROP np); /* property set context*/
  141. NTSTATUS PROPSYSAPI PROPAPI
  142. RtlSetProperties(
  143. IN NTPROP np, /* property set context*/
  144. IN ULONG cprop, /* property count*/
  145. IN PROPID pidNameFirst, /* first PROPID for new named properties*/
  146. IN PROPSPEC const aprs[], /* array of property specifiers*/
  147. OPTIONAL OUT PROPID apid[], /* buffer for array of propids*/
  148. OPTIONAL IN PROPVARIANT const avar[]);/* array of properties with values*/
  149. NTSTATUS PROPSYSAPI PROPAPI
  150. RtlQueryProperties(
  151. IN NTPROP np, /* property set context*/
  152. IN ULONG cprop, /* property count*/
  153. IN PROPSPEC const aprs[], /* array of property specifiers*/
  154. OPTIONAL OUT PROPID apid[], /* buffer for array of propids*/
  155. IN OUT PROPVARIANT *avar, /* IN: array of uninitialized PROPVARIANTs,*/
  156. /* OUT: may contain pointers to alloc'd memory*/
  157. OUT ULONG *pcpropFound); /* count of property values retrieved*/
  158. #define ENUMPROP_NONAMES 0x00000001 /* return property IDs only*/
  159. NTSTATUS PROPSYSAPI PROPAPI
  160. RtlEnumerateProperties(
  161. IN NTPROP np, /* property set context*/
  162. IN ULONG Flags, /* flags: No Names (propids only), etc.*/
  163. IN OUT ULONG *pkey, /* bookmark; caller set to 0 before 1st call*/
  164. IN OUT ULONG *pcprop, /* pointer to property count*/
  165. OPTIONAL OUT PROPSPEC aprs[],/* IN: array of uninitialized PROPSPECs*/
  166. /* OUT: may contain pointers to alloc'd strings*/
  167. OPTIONAL OUT STATPROPSTG asps[]);
  168. /* IN: array of uninitialized STATPROPSTGs*/
  169. /* OUT: may contain pointers to alloc'd strings*/
  170. NTSTATUS PROPSYSAPI PROPAPI
  171. RtlQueryPropertyNames(
  172. IN NTPROP np, /* property set context*/
  173. IN ULONG cprop, /* property count*/
  174. IN PROPID const *apid, /* PROPID array*/
  175. OUT OLECHAR *apwsz[] /* OUT pointers to allocated strings*/
  176. );
  177. NTSTATUS PROPSYSAPI PROPAPI
  178. RtlSetPropertyNames(
  179. IN NTPROP np, /* property set context*/
  180. IN ULONG cprop, /* property count*/
  181. IN PROPID const *apid, /* PROPID array*/
  182. IN OLECHAR const * const apwsz[] /* pointers to property names*/
  183. );
  184. NTSTATUS PROPSYSAPI PROPAPI
  185. RtlSetPropertySetClassId(
  186. IN NTPROP np, /* property set context*/
  187. IN GUID const *pclsid /* new CLASSID of propset code*/
  188. );
  189. NTSTATUS PROPSYSAPI PROPAPI
  190. RtlQueryPropertySet(
  191. IN NTPROP np, /* property set context*/
  192. OUT STATPROPSETSTG *pspss /* buffer for property set stat information*/
  193. );
  194. NTSTATUS PROPSYSAPI PROPAPI
  195. RtlEnumeratePropertySets(
  196. IN HANDLE hstg, /* structured storage handle*/
  197. IN BOOLEAN fRestart, /* restart scan*/
  198. IN OUT ULONG *pcspss, /* pointer to count of STATPROPSETSTGs*/
  199. IN OUT GUID *pkey, /* bookmark*/
  200. OUT STATPROPSETSTG *pspss /* array of STATPROPSETSTGs*/
  201. );
  202. #ifdef __cplusplus
  203. }
  204. #endif
  205. #endif /* ifndef _PROPAPI_H_*/