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.

206 lines
3.7 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. STATUS_HANDLE_NOT_CLOSABLE,
  97. STATUS_IN_PAGE_ERROR
  98. };
  99. const int FATAL_EXCEPTIONS_ARRAY_SIZE = sizeof(FatalExceptions) / sizeof(FatalExceptions[0]);
  100. int
  101. RPC_ENTRY
  102. I_RpcExceptionFilter (
  103. unsigned long ExceptionCode
  104. )
  105. {
  106. int i;
  107. for (i = 0; i < FATAL_EXCEPTIONS_ARRAY_SIZE; i ++)
  108. {
  109. if (ExceptionCode == FatalExceptions[i])
  110. return EXCEPTION_CONTINUE_SEARCH;
  111. }
  112. return EXCEPTION_EXECUTE_HANDLER;
  113. }
  114. #ifdef STATS
  115. DWORD g_dwStat1 = 0;
  116. DWORD g_dwStat2 = 0;
  117. DWORD g_dwStat3 = 0;
  118. DWORD g_dwStat4 = 0;
  119. void RPC_ENTRY I_RpcGetStats(DWORD *pdwStat1, DWORD *pdwStat2, DWORD *pdwStat3, DWORD *pdwStat4)
  120. {
  121. GetStats(pdwStat1, pdwStat2, pdwStat3, pdwStat4);
  122. }
  123. #endif
  124. extern "C"
  125. {
  126. void RPC_ENTRY
  127. I_RpcTimeReset(
  128. void
  129. )
  130. /*++
  131. Routine Description:
  132. This routine is no longer used, however, because it is exported by the
  133. dll, we need to leave the entry point.
  134. --*/
  135. {
  136. }
  137. void RPC_ENTRY
  138. I_RpcTimeCharge(
  139. unsigned int Ignore
  140. )
  141. /*++
  142. Routine Description:
  143. This routine is no longer used, however, because it is exported by the
  144. dll, we need to leave the entry point.
  145. --*/
  146. {
  147. UNUSED(Ignore);
  148. }
  149. unsigned long * RPC_ENTRY
  150. I_RpcTimeGet(
  151. char __RPC_FAR * Ignore
  152. )
  153. /*++
  154. Routine Description:
  155. This routine is no longer used, however, because it is exported by the
  156. dll, we need to leave the entry point.
  157. --*/
  158. {
  159. UNUSED(Ignore);
  160. return(0);
  161. }
  162. };