Source code of Windows XP (NT5)
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.

261 lines
10 KiB

  1. /* $Workfile: xomi.h $ $Revision: 1.1 $ */
  2. /* WORKSPACE INTERFACE */
  3. typedef OM_descriptor OMP_object_header[2];
  4. typedef OMP_object_header FAR * OMP_object;
  5. typedef OM_return_code
  6. (XOMAPI *OMP_copy) (
  7. OM_private_object original,
  8. OM_workspace workspace,
  9. OM_private_object FAR * copy
  10. );
  11. typedef OM_return_code
  12. (XOMAPI *OMP_copy_value) (
  13. OM_private_object source,
  14. OM_type source_type,
  15. OM_value_position source_value_position,
  16. OM_private_object destination,
  17. OM_type destination_type,
  18. OM_value_position destination_value_position
  19. );
  20. typedef OM_return_code
  21. (XOMAPI *OMP_create) (
  22. OM_object_identifier _class,
  23. OM_boolean initialise,
  24. OM_workspace workspace,
  25. OM_private_object FAR * object
  26. );
  27. typedef OM_return_code
  28. (XOMAPI *OMP_decode) (
  29. OM_private_object encoding,
  30. OM_private_object FAR * original
  31. );
  32. typedef OM_return_code
  33. (XOMAPI *OMP_delete) (
  34. OM_object subject
  35. );
  36. typedef OM_return_code
  37. (XOMAPI *OMP_encode) (
  38. OM_private_object original,
  39. OM_object_identifier rules,
  40. OM_private_object FAR * encoding
  41. );
  42. typedef OM_return_code
  43. (XOMAPI *OMP_get) (
  44. OM_private_object original,
  45. OM_exclusions exclusions,
  46. OM_type_list included_types,
  47. OM_boolean local_strings,
  48. OM_value_position initial_value,
  49. OM_value_position limiting_value,
  50. OM_public_object FAR * copy,
  51. OM_value_position FAR * total_number
  52. );
  53. typedef OM_return_code
  54. (XOMAPI *OMP_instance) (
  55. OM_object subject,
  56. OM_object_identifier _class,
  57. OM_boolean FAR * instance
  58. );
  59. typedef OM_return_code
  60. (XOMAPI *OMP_put) (
  61. OM_private_object destination,
  62. OM_modification modification,
  63. OM_object source,
  64. OM_type_list included_types,
  65. OM_value_position initial_value,
  66. OM_value_position limiting_value
  67. );
  68. typedef OM_return_code
  69. (XOMAPI *OMP_read) (
  70. OM_private_object subject,
  71. OM_type type,
  72. OM_value_position value_position,
  73. OM_boolean local_string,
  74. OM_string_length FAR * string_offset,
  75. OM_string FAR * elements
  76. );
  77. typedef OM_return_code
  78. (XOMAPI *OMP_remove) (
  79. OM_private_object subject,
  80. OM_type type,
  81. OM_value_position initial_value,
  82. OM_value_position limiting_value
  83. );
  84. typedef OM_return_code
  85. (XOMAPI *OMP_write) (
  86. OM_private_object subject,
  87. OM_type type,
  88. OM_value_position value_position,
  89. OM_syntax syntax,
  90. OM_string_length FAR * string_offset,
  91. OM_string elements
  92. );
  93. /* C++ doesn't do very well with the structures */
  94. /* and macros that follow here. */
  95. #ifndef __cplusplus
  96. typedef struct OMP_functions_body {
  97. OM_uint32 function_number;
  98. OMP_copy copy;
  99. OMP_copy_value copy_value;
  100. OMP_create create;
  101. OMP_decode decode;
  102. OMP_delete delete;
  103. OMP_encode encode;
  104. OMP_get get;
  105. OMP_instance instance;
  106. OMP_put put;
  107. OMP_read read;
  108. OMP_remove remove;
  109. OMP_write write;
  110. } OMP_functions;
  111. typedef struct OMP_workspace_body {
  112. struct OMP_functions_body FAR * functions;
  113. } FAR * OMP_workspace;
  114. #define OMP_EXTERNAL(internal) ((OM_object)((OM_descriptor FAR *)(internal) + 1))
  115. #define OMP_INTERNAL(external) ((OM_descriptor FAR *)(external) - 1)
  116. #define OMP_TYPE(external) (((OM_descriptor FAR *)(external))->type)
  117. #define OMP_WORKSPACE(external) ((OMP_workspace)(OMP_INTERNAL(external)->value.string.elements))
  118. #define OMP_FUNCTIONS(external) (OMP_WORKSPACE(external)->functions)
  119. #define om_copy(ORIGINAL,WORKSPACE,COPY) ((ORIGINAL)->type == OM_PRIVATE_OBJECT ? ((OMP_workspace)(WORKSPACE))->functions->copy((ORIGINAL),(WORKSPACE),(COPY)) : OM_NOT_PRIVATE)
  120. #define om_copy_value(SOURCE, SOURCE_TYPE, SOURCE_POSITION, DEST, DEST_TYPE, DEST_POSITION) \
  121. ((((SOURCE)->type == OM_PRIVATE_OBJECT) && ((DEST)->type == OM_PRIVATE_OBJECT)) ? OMP_FUNCTIONS(DEST)->copy_value((SOURCE), (SOURCE_TYPE), (SOURCE_POSITION), (DEST), (DEST_TYPE), (DEST_POSITION)) : OM_NOT_PRIVATE)
  122. #ifdef PIMPORT_DLL_DATA
  123. #define om_create(CLASS,INITIALISE,WORKSPACE,OBJECT) (((OMP_workspace)(WORKSPACE))->functions->create(*(CLASS),(INITIALISE),(WORKSPACE),(OBJECT)))
  124. #else
  125. #define om_create(CLASS,INITIALISE,WORKSPACE,OBJECT) (((OMP_workspace)(WORKSPACE))->functions->create((CLASS),(INITIALISE),(WORKSPACE),(OBJECT)))
  126. #endif
  127. #define om_decode(ENCODING,ORIGINAL) ((ENCODING)->type == OM_PRIVATE_OBJECT ? OMP_FUNCTIONS(ENCODING)->decode((ENCODING),(ORIGINAL)) : OM_NOT_PRIVATE)
  128. #define om_delete(SUBJECT) (((SUBJECT)->syntax & OM_S_SERVICE_GENERATED) ? OMP_FUNCTIONS(SUBJECT)->delete((SUBJECT)) : OM_NOT_THE_SERVICES)
  129. #define om_encode(ORIGINAL,RULES,ENCODING) ((ORIGINAL)->type == OM_PRIVATE_OBJECT ? OMP_FUNCTIONS(ORIGINAL)->encode((ORIGINAL),(RULES),(ENCODING)) : OM_NOT_PRIVATE)
  130. #define om_get(ORIGINAL,EXCLUSIONS,TYPES,LOCAL_STRINGS,INITIAL,LIMIT,COPY,TOTAL_NUMBER) \
  131. ((ORIGINAL)->type == OM_PRIVATE_OBJECT ? OMP_FUNCTIONS(ORIGINAL)->get((ORIGINAL),(EXCLUSIONS),(TYPES),(LOCAL_STRINGS),(INITIAL),(LIMIT),(COPY),(TOTAL_NUMBER)) : OM_NOT_PRIVATE)
  132. #ifdef PIMPORT_DLL_DATA
  133. #define om_instance(SUBJECT,CLASS,INSTANCE) (((SUBJECT)->syntax & OM_S_SERVICE_GENERATED) ? OMP_FUNCTIONS(SUBJECT)->instance((SUBJECT),*(CLASS),(INSTANCE)) : OM_NOT_THE_SERVICES)
  134. #else
  135. #define om_instance(SUBJECT,CLASS,INSTANCE) (((SUBJECT)->syntax & OM_S_SERVICE_GENERATED) ? OMP_FUNCTIONS(SUBJECT)->instance((SUBJECT),(CLASS),(INSTANCE)) : OM_NOT_THE_SERVICES)
  136. #endif
  137. #define om_put(DESTINATION,MODIFICATION,SOURCE,INCLUDED_TYPES,INITIAL,LIMIT) ((DESTINATION)->type == OM_PRIVATE_OBJECT ? OMP_FUNCTIONS(DESTINATION)->put((DESTINATION),(MODIFICATION),(SOURCE),(INCLUDED_TYPES),(INITIAL),(LIMIT)) : OM_NOT_PRIVATE)
  138. #define om_read(SUBJECT,TYPE,VALUE_POS,LOCAL_STRING,STRING_OFFSET,ELEMENTS) ((SUBJECT)->type == OM_PRIVATE_OBJECT ? OMP_FUNCTIONS(SUBJECT)->read((SUBJECT),(TYPE),(VALUE_POS),(LOCAL_STRING),(STRING_OFFSET),(ELEMENTS)) : OM_NOT_PRIVATE)
  139. #define om_remove(SUBJECT,TYPE,INITIAL,LIMIT) ((SUBJECT)->type == OM_PRIVATE_OBJECT ? OMP_FUNCTIONS(SUBJECT)->remove((SUBJECT),(TYPE),(INITIAL),(LIMIT)) : OM_NOT_PRIVATE)
  140. #define om_write(SUBJECT,TYPE,VALUE_POS,SYNTAX,STRING_OFFSET,ELEMENTS) \
  141. ((SUBJECT)->type == OM_PRIVATE_OBJECT ? OMP_FUNCTIONS(SUBJECT)->write((SUBJECT),(TYPE),(VALUE_POS),(SYNTAX),(STRING_OFFSET),(ELEMENTS)) : OM_NOT_PRIVATE)
  142. #else /*_cplusplus*/
  143. typedef struct OMP_functions_body {
  144. OM_uint32 _function_number;
  145. OMP_copy _copy;
  146. OMP_copy_value _copy_value;
  147. OMP_create _create;
  148. OMP_decode _decode;
  149. OMP_delete _delete;
  150. OMP_encode _encode;
  151. OMP_get _get;
  152. OMP_instance _instance;
  153. OMP_put _put;
  154. OMP_read _read;
  155. OMP_remove _remove;
  156. OMP_write _write;
  157. } OMP_functions;
  158. typedef struct OMP_workspace_body {
  159. struct OMP_functions_body FAR * _functions;
  160. } FAR * OMP_workspace;
  161. #define OMP_EXTERNAL(internal) ((OM_object)((OM_descriptor FAR *)(internal) + 1))
  162. #define OMP_INTERNAL(external) ((OM_descriptor FAR *)(external) - 1)
  163. #define OMP_TYPE(external) (((OM_descriptor FAR *)(external))->type)
  164. #define OMP_WORKSPACE(external) ((OMP_workspace)(OMP_INTERNAL(external)->value.string.elements))
  165. #define OMP_FUNCTIONS(external) (OMP_WORKSPACE(external)->_functions)
  166. #define om_copy(ORIGINAL,WORKSPACE,COPY) ((ORIGINAL)->type == OM_PRIVATE_OBJECT ? ((OMP_workspace)(WORKSPACE))->_functions->_copy((ORIGINAL),(WORKSPACE),(COPY)) : OM_NOT_PRIVATE)
  167. #define om_copy_value(SOURCE, SOURCE_TYPE, SOURCE_POSITION, DEST, DEST_TYPE, DEST_POSITION) \
  168. ((((SOURCE)->type == OM_PRIVATE_OBJECT) && ((DEST)->type == OM_PRIVATE_OBJECT)) ? OMP_FUNCTIONS(DEST)->_copy_value((SOURCE), (SOURCE_TYPE), (SOURCE_POSITION), (DEST), (DEST_TYPE), (DEST_POSITION)) : OM_NOT_PRIVATE)
  169. #define om_create(CLASS,INITIALISE,WORKSPACE,OBJECT) (((OMP_workspace)(WORKSPACE))->_functions->_create((CLASS),(INITIALISE),(WORKSPACE),(OBJECT)))
  170. #define om_decode(ENCODING,ORIGINAL) ((ENCODING)->type == OM_PRIVATE_OBJECT ? OMP_FUNCTIONS(ENCODING)->_decode((ENCODING),(ORIGINAL)) : OM_NOT_PRIVATE)
  171. #define om_delete(SUBJECT) (((SUBJECT)->syntax & OM_S_SERVICE_GENERATED) ? OMP_FUNCTIONS(SUBJECT)->_delete((SUBJECT)) : OM_NOT_THE_SERVICES)
  172. #define om_encode(ORIGINAL,RULES,ENCODING) ((ORIGINAL)->type == OM_PRIVATE_OBJECT ? OMP_FUNCTIONS(ORIGINAL)->_encode((ORIGINAL),(RULES),(ENCODING)) : OM_NOT_PRIVATE)
  173. #define om_get(ORIGINAL,EXCLUSIONS,TYPES,LOCAL_STRINGS,INITIAL,LIMIT,COPY,TOTAL_NUMBER) \
  174. ((ORIGINAL)->type == OM_PRIVATE_OBJECT ? OMP_FUNCTIONS(ORIGINAL)->_get((ORIGINAL),(EXCLUSIONS),(TYPES),(LOCAL_STRINGS),(INITIAL),(LIMIT),(COPY),(TOTAL_NUMBER)) : OM_NOT_PRIVATE)
  175. #define om_instance(SUBJECT,CLASS,INSTANCE) (((SUBJECT)->syntax & OM_S_SERVICE_GENERATED) ? OMP_FUNCTIONS(SUBJECT)->_instance((SUBJECT),(CLASS),(INSTANCE)) : OM_NOT_THE_SERVICES)
  176. #define om_put(DESTINATION,MODIFICATION,SOURCE,INCLUDED_TYPES,INITIAL,LIMIT) ((DESTINATION)->type == OM_PRIVATE_OBJECT ? OMP_FUNCTIONS(DESTINATION)->_put((DESTINATION),(MODIFICATION),(SOURCE),(INCLUDED_TYPES),(INITIAL),(LIMIT)) : OM_NOT_PRIVATE)
  177. #define om_read(SUBJECT,TYPE,VALUE_POS,LOCAL_STRING,STRING_OFFSET,ELEMENTS) ((SUBJECT)->type == OM_PRIVATE_OBJECT ? OMP_FUNCTIONS(SUBJECT)->_read((SUBJECT),(TYPE),(VALUE_POS),(LOCAL_STRING),(STRING_OFFSET),(ELEMENTS)) : OM_NOT_PRIVATE)
  178. #define om_remove(SUBJECT,TYPE,INITIAL,LIMIT) ((SUBJECT)->type == OM_PRIVATE_OBJECT ? OMP_FUNCTIONS(SUBJECT)->_remove((SUBJECT),(TYPE),(INITIAL),(LIMIT)) : OM_NOT_PRIVATE)
  179. #define om_write(SUBJECT,TYPE,VALUE_POS,SYNTAX,STRING_OFFSET,ELEMENTS) \
  180. ((SUBJECT)->type == OM_PRIVATE_OBJECT ? OMP_FUNCTIONS(SUBJECT)->_write((SUBJECT),(TYPE),(VALUE_POS),(SYNTAX),(STRING_OFFSET),(ELEMENTS)) : OM_NOT_PRIVATE)
  181. #endif