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.

204 lines
3.5 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1991 - 1999
  6. //
  7. // File: clntapip.cxx
  8. //
  9. //--------------------------------------------------------------------------
  10. /* --------------------------------------------------------------------
  11. Microsoft OS/2 LAN Manager
  12. Copyright(c) Microsoft Corp., 1990
  13. -------------------------------------------------------------------- */
  14. /* --------------------------------------------------------------------
  15. File : clntapip.cxx
  16. Description :
  17. This file contains the private entry points into the client (and
  18. server) runtime.
  19. History :
  20. mikemon 02-02-91 Created.
  21. -------------------------------------------------------------------- */
  22. #include <precomp.hxx>
  23. #ifdef DOS
  24. THREAD ThreadStatic;
  25. #endif
  26. void PAPI * RPC_ENTRY
  27. I_RpcAllocate (
  28. IN unsigned int size
  29. )
  30. {
  31. #ifdef RPC_DELAYED_INITIALIZATION
  32. if ( RpcHasBeenInitialized == 0 )
  33. {
  34. if ( PerformRpcInitialization() != RPC_S_OK )
  35. {
  36. return(0);
  37. }
  38. }
  39. #endif // RPC_DELAYED_INITIALIZATION
  40. return(RpcpFarAllocate(size));
  41. }
  42. void RPC_ENTRY
  43. I_RpcFree (
  44. IN void PAPI * obj
  45. )
  46. {
  47. RpcpFarFree(obj);
  48. }
  49. void PAPI * RPC_ENTRY
  50. I_RpcBCacheAllocate (
  51. IN unsigned int size
  52. )
  53. {
  54. if (!ThreadSelf())
  55. return NULL;
  56. return(RpcAllocateBuffer(size));
  57. }
  58. void RPC_ENTRY
  59. I_RpcBCacheFree (
  60. IN void PAPI * obj
  61. )
  62. {
  63. RpcFreeBuffer(obj);
  64. }
  65. RPC_STATUS
  66. I_RpcSetNDRSlot(
  67. IN void *NewSlot
  68. )
  69. {
  70. return RpcpSetNDRSlot(NewSlot);
  71. }
  72. void *
  73. I_RpcGetNDRSlot(
  74. void
  75. )
  76. {
  77. return RpcpGetNDRSlot();
  78. }
  79. void RPC_ENTRY
  80. I_RpcPauseExecution (
  81. IN unsigned long milliseconds
  82. )
  83. {
  84. PauseExecution(milliseconds);
  85. }
  86. const ULONG FatalExceptions[] =
  87. {
  88. STATUS_ACCESS_VIOLATION,
  89. STATUS_POSSIBLE_DEADLOCK,
  90. STATUS_INSTRUCTION_MISALIGNMENT,
  91. STATUS_DATATYPE_MISALIGNMENT,
  92. STATUS_PRIVILEGED_INSTRUCTION,
  93. STATUS_ILLEGAL_INSTRUCTION,
  94. STATUS_BREAKPOINT,
  95. STATUS_STACK_OVERFLOW
  96. };
  97. const int FATAL_EXCEPTIONS_ARRAY_SIZE = sizeof(FatalExceptions) / sizeof(FatalExceptions[0]);
  98. int
  99. RPC_ENTRY
  100. I_RpcExceptionFilter (
  101. unsigned long ExceptionCode
  102. )
  103. {
  104. int i;
  105. for (i = 0; i < FATAL_EXCEPTIONS_ARRAY_SIZE; i ++)
  106. {
  107. if (ExceptionCode == FatalExceptions[i])
  108. return EXCEPTION_CONTINUE_SEARCH;
  109. }
  110. return EXCEPTION_EXECUTE_HANDLER;
  111. }
  112. #ifdef STATS
  113. DWORD g_dwStat1 = 0;
  114. DWORD g_dwStat2 = 0;
  115. DWORD g_dwStat3 = 0;
  116. DWORD g_dwStat4 = 0;
  117. void RPC_ENTRY I_RpcGetStats(DWORD *pdwStat1, DWORD *pdwStat2, DWORD *pdwStat3, DWORD *pdwStat4)
  118. {
  119. GetStats(pdwStat1, pdwStat2, pdwStat3, pdwStat4);
  120. }
  121. #endif
  122. extern "C"
  123. {
  124. void RPC_ENTRY
  125. I_RpcTimeReset(
  126. void
  127. )
  128. /*++
  129. Routine Description:
  130. This routine is no longer used, however, because it is exported by the
  131. dll, we need to leave the entry point.
  132. --*/
  133. {
  134. }
  135. void RPC_ENTRY
  136. I_RpcTimeCharge(
  137. unsigned int Ignore
  138. )
  139. /*++
  140. Routine Description:
  141. This routine is no longer used, however, because it is exported by the
  142. dll, we need to leave the entry point.
  143. --*/
  144. {
  145. UNUSED(Ignore);
  146. }
  147. unsigned long * RPC_ENTRY
  148. I_RpcTimeGet(
  149. char __RPC_FAR * Ignore
  150. )
  151. /*++
  152. Routine Description:
  153. This routine is no longer used, however, because it is exported by the
  154. dll, we need to leave the entry point.
  155. --*/
  156. {
  157. UNUSED(Ignore);
  158. return(0);
  159. }
  160. };