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.

85 lines
2.1 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1996 - 1999
  6. //
  7. // File: pipe.h
  8. //
  9. //--------------------------------------------------------------------------
  10. #ifndef __PIPE_HXX
  11. #define __PIPE_HXX
  12. enum receive_states {
  13. start,
  14. copy_pipe_elem,
  15. return_partial_pipe_elem, // also save pipe elem
  16. return_partial_count, // also save count
  17. read_partial_count, // also a start state
  18. read_partial_pipe_elem //also a start state
  19. } ;
  20. typedef struct {
  21. void *Buffer ;
  22. int BufferLength ;
  23. receive_states CurrentState ;
  24. char PAPI *CurPointer ; // current pointer in the buffer
  25. int BytesRemaining ; // bytes remaining in current buffer
  26. int ElementsRemaining ; // elements remaining in current pipe chunk
  27. DWORD PartialCount ;
  28. int PartialCountSize ;
  29. int PartialPipeElementSize ;
  30. int EndOfPipe ;
  31. int PipeElementSize ;
  32. void PAPI *PartialPipeElement ;
  33. void PAPI *AllocatedBuffer ;
  34. int BufferSize ;
  35. int SendBufferOffset ;
  36. void PAPI *PreviousBuffer ;
  37. int PreviousBufferSize ;
  38. HANDLE BindingHandle;
  39. } PIPE_STATE ;
  40. //
  41. // N.B. this structure is the same as MIDL_ASYNC_STUB_STATE
  42. //
  43. typedef struct async_stub_state {
  44. void *CallHandle ;
  45. RPC_STATUS (*CompletionRoutine) (
  46. PRPC_ASYNC_STATE pAsync,
  47. void *Reply) ;
  48. int Length ;
  49. void *UserData ;
  50. int State ;
  51. void *Buffer ;
  52. int BufferLength ;
  53. unsigned long Flags ;
  54. PIPE_STATE PipeState ;
  55. BOOL (*ReceiveFunction) (
  56. PRPC_ASYNC_STATE pAsync,
  57. PRPC_MESSAGE Message) ;
  58. } RPC_ASYNC_STUB_STATE ;
  59. void I_RpcReadPipeElementsFromBuffer (
  60. PIPE_STATE PAPI *state,
  61. char PAPI *TargetBuffer,
  62. int TargetBufferSize,
  63. int PAPI *NumCopied
  64. ) ;
  65. //states
  66. enum
  67. {
  68. SEND_COMPLETE,
  69. SEND_INCOMPLETE
  70. } ;
  71. RPC_STATUS RPC_ENTRY
  72. MyRpcCompleteAsyncCall (
  73. IN PRPC_ASYNC_STATE pAsync,
  74. IN void *Reply
  75. );
  76. #define STUB(_x_) ((RPC_ASYNC_STUB_STATE *) (_x_->StubInfo))
  77. #endif