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.

133 lines
7.2 KiB

  1. /*****************************************************************************/
  2. /* Copyright (C) 1991-1999 Open Systems Solutions, Inc. All rights reserved.*/
  3. /*****************************************************************************/
  4. /* THIS FILE IS PROPRIETARY MATERIAL OF OPEN SYSTEMS SOLUTIONS, INC.
  5. * AND MAY ONLY BE USED BY DIRECT LICENSEES OF OPEN SYSTEMS SOLUTIONS, INC.
  6. * THIS FILE MAY NOT BE DISTRIBUTED. */
  7. /*************************************************************************/
  8. /* FILE: @(#)ossmmgmt.h 5.8.1.2 97/10/20 */
  9. /*************************************************************************/
  10. #if _MSC_VER > 1000
  11. #pragma once
  12. #endif
  13. #include <stddef.h>
  14. #include "ossdll.h"
  15. enum errcode {
  16. moreInput, /* input is exhausted and more was requested;
  17. context indicates number of bytes requested */
  18. /* decode returns MORE_INPUT (not a negative
  19. error code) */
  20. moreOutput, /* requests for output exceed restraint
  21. or space provided by user buffer;
  22. context indicates bytes allocated so far
  23. plus amount requested */
  24. /* decode returns MORE_BUF */
  25. zeroBytesRequested, /* memory request for zero bytes.
  26. This should not happen; report error to OSS;
  27. context ignored */
  28. /* decode returns FATAL_ERROR */
  29. sizeTooBig, /* request to allocate more than 'ossblock' bytes;
  30. context indicates number of bytes requested;
  31. This should not happen; report error to OSS */
  32. /* decode returns FATAL_ERROR */
  33. outOfMemory, /* memory allocation failure; context indicates
  34. number of bytes requested */
  35. /* decode returns OUT_MEMORY */
  36. invalidObject, /* unrecognized memory object passed in argument
  37. to function; context 0 means object not recognized,
  38. 1 means control information within object is flawed */
  39. /* decode returns FATAL_ERROR */
  40. #ifdef LEAN_STACK
  41. moreStack, /* requests for stack storage exceed
  42. space provided by user buffer;
  43. context indicates bytes allocated so far
  44. plus amount requested */
  45. /* decode returns MORE_BUF */
  46. hookedStack, /* request for stack storage cannot be
  47. served in the parent context (world) when
  48. user-provided buffer is used by the child
  49. context */
  50. /* decode returns MEM_ERROR */
  51. #endif
  52. memmgrUndefinedErr /* error OSS has not anticipated; e.g., I/O Error;
  53. handlerr prints context.
  54. (I cannot print context as a hex value
  55. with the current error message code <---) */
  56. /* decode returns FATAL_ERROR */
  57. };
  58. extern void handlerr(struct ossGlobal *, enum errcode err, unsigned long context);
  59. extern int DLL_ENTRY dpduWalk(struct ossGlobal *, int, void *, void *,
  60. void (DLL_ENTRY_FPTR *_System freer)(struct ossGlobal *, void *));
  61. #if defined(_WINDOWS) || defined(_WIN32) || \
  62. defined(__OS2__) || defined(NETWARE_DLL)
  63. extern void DLL_ENTRY ossFreer(void *, void *);
  64. #else
  65. #ifndef _ICC
  66. static void DLL_ENTRY freer(struct ossGlobal *, void *);
  67. #endif /* _ICC */
  68. #endif /* _WINDOWS || _WIN32 || __OS2__ || NETWARE_DLL */
  69. int DLL_ENTRY ossMemMgrId(struct ossGlobal *);
  70. unsigned char *DLL_ENTRY dopenIn(struct ossGlobal *, void **p_hdl, unsigned long *inlen);
  71. unsigned long DLL_ENTRY dclosIn(struct ossGlobal *, void **p_hdl, size_t bytes_decoded);
  72. unsigned char *DLL_ENTRY dswapIn(struct ossGlobal *, void **p_hdl, size_t *inlen);
  73. void DLL_ENTRY dopenOut(struct ossGlobal *, void *hdl, unsigned long length,
  74. unsigned long limit);
  75. unsigned long DLL_ENTRY dclosOut(struct ossGlobal *, void **p_hdl);
  76. void *DLL_ENTRY dallcOut(struct ossGlobal *, size_t size, char root);
  77. #ifdef LEAN_STACK
  78. void DLL_ENTRY_FDEF openStack(struct ossGlobal *world, OssBuf *stack);
  79. void DLL_ENTRY_FDEF hookStack(struct ossGlobal *world, struct ossGlobal *root);
  80. void DLL_ENTRY_FDEF unhookStack(struct ossGlobal *world, struct ossGlobal *root);
  81. void *DLL_ENTRY_FDEF allocStack(struct ossGlobal *world, size_t size);
  82. unsigned char *DLL_ENTRY_FDEF lockStack(struct ossGlobal *world, void *hdl);
  83. void DLL_ENTRY_FDEF freeStack(struct ossGlobal *world, void *hdl);
  84. void DLL_ENTRY_FDEF closeStack(struct ossGlobal *world);
  85. #endif /* LEAN_STACK */
  86. void DLL_ENTRY openWork(struct ossGlobal *);
  87. void DLL_ENTRY closWork(struct ossGlobal *);
  88. void *DLL_ENTRY allcWork(struct ossGlobal *, size_t size);
  89. unsigned char *DLL_ENTRY lockMem(struct ossGlobal *, void *hdl);
  90. void DLL_ENTRY unlokMem(struct ossGlobal *, void *hdl, char free);
  91. void DLL_ENTRY pushHndl(struct ossGlobal *, void *);
  92. unsigned char *DLL_ENTRY popHndl(struct ossGlobal *, void **handl, size_t length);
  93. void DLL_ENTRY drcovObj(struct ossGlobal *, int pdu_num, void * hdl, void *ctl_tbl);
  94. unsigned char *DLL_ENTRY eopenIn(struct ossGlobal *, void *lock, size_t length); /* Clear encoder input-memory resources */
  95. unsigned char *DLL_ENTRY eswapIn(struct ossGlobal *, void *unlock, void *lock, size_t length); /* Swap new data into input memory */
  96. void DLL_ENTRY eclosIn(struct ossGlobal *, void * unlock); /* Free encoder input-memory resources */
  97. unsigned char *DLL_ENTRY eopenOut(struct ossGlobal *, void **object, size_t *outlen, char queue); /* Clear encoder output-memory resources */
  98. unsigned char *DLL_ENTRY eswapOut(struct ossGlobal *, void **object, size_t used, size_t *outlen); /* Dispose of output data and get memory */
  99. unsigned char *DLL_ENTRY exferObj(struct ossGlobal *, void **, void **, unsigned long *, unsigned long);
  100. unsigned char *DLL_ENTRY dxferObj(struct ossGlobal *world, void **inn, void **out, size_t *tOffset, unsigned long *toLength);
  101. unsigned char *DLL_ENTRY asideBegin(struct ossGlobal *world, void **objectTo, size_t used, size_t *lengthTo);
  102. unsigned char *DLL_ENTRY asideSwap(struct ossGlobal *world, void **objectTo, size_t used, size_t *lengthTo);
  103. void *DLL_ENTRY asideEnd(struct ossGlobal *world, void *object, size_t used);
  104. unsigned char *DLL_ENTRY setDump(struct ossGlobal *world, void **objectTo, void *set, size_t *lengthTo);
  105. unsigned long DLL_ENTRY eclosOut(struct ossGlobal *, void **object, size_t used, char low); /* Free encoder output-memory resources */
  106. void DLL_ENTRY ercovObj(struct ossGlobal *); /* Free all encoder memory resources */
  107. void DLL_ENTRY ossSetSort(struct ossGlobal *, void *, unsigned char ct); /* Order set by comparing through "ossObjCmp" */
  108. unsigned char DLL_ENTRY egetByte(struct ossGlobal *world, void *inn, unsigned long offset);
  109. extern int DLL_ENTRY ossMinit(struct ossGlobal *world);
  110. extern void DLL_ENTRY ossMterm(struct ossGlobal *world);
  111. void *DLL_ENTRY _ossMarkObj(struct ossGlobal *world, OssObjType objType, void *object);
  112. void *DLL_ENTRY _ossUnmarkObj(struct ossGlobal *world, void *objHndl);
  113. void *DLL_ENTRY _ossGetObj(struct ossGlobal *world, void *objHndl);
  114. #if defined(__arm)
  115. OssObjType DLL_ENTRY _ossTestObj(struct ossGlobal *world, void *objHndl);
  116. #else
  117. void *DLL_ENTRY _ossTestObj(struct ossGlobal *world, void *objHndl);
  118. #endif /* __arm */
  119. void DLL_ENTRY _ossFreeObjectStack(struct ossGlobal *world);
  120. void DLL_ENTRY _ossSetTimeout(struct ossGlobal *world, long timeout);