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.

76 lines
2.4 KiB

  1. /****************************************************************************/
  2. // noadisp.h
  3. //
  4. // DD-specific header for OA
  5. //
  6. // Copyright (C) 1997-2000 Microsoft Corporation
  7. /****************************************************************************/
  8. #ifndef __OADISP_H
  9. #define __OADISP_H
  10. #include <aoaapi.h>
  11. #include <aoacom.h>
  12. #include <nddapi.h>
  13. void RDPCALL OA_DDInit();
  14. void RDPCALL OA_InitShm(void);
  15. void OA_AppendToOrderList(PINT_ORDER);
  16. PINT_ORDER RDPCALL OA_AllocOrderMem(PDD_PDEV, unsigned);
  17. void RDPCALL OA_FreeOrderMem(PINT_ORDER);
  18. /****************************************************************************/
  19. // OA_DDSyncUpdatesNow
  20. //
  21. // Called when a sync operation is required.
  22. /****************************************************************************/
  23. __inline void OA_DDSyncUpdatesNow()
  24. {
  25. // Discard all outstanding orders.
  26. OA_ResetOrderList();
  27. }
  28. /****************************************************************************/
  29. // OA_AppendToOrderList
  30. //
  31. // Finalizes the heap addition of an order, without doing extra processing,
  32. // by adding the final order size to the total size of ready-to-send orders
  33. // in the heap.
  34. /****************************************************************************/
  35. void OA_AppendToOrderList(PINT_ORDER _pOrder);
  36. /****************************************************************************/
  37. // OA_TruncateAllocatedOrder
  38. //
  39. // Returns heap space at the end of the heap allocated via OA_AllocOrderMem.
  40. // Requires a bit more housekeeping than returning additional order mem.
  41. // The caller should be sure that no other orders or additional order mem
  42. // has been allocated after this order. NewSize is the final size
  43. // of the order.
  44. //
  45. // __inline void OA_TruncateAllocatedOrder(
  46. // INT_ORDER *pOrder,
  47. // unsigned NewSize)
  48. /****************************************************************************/
  49. #define OA_TruncateAllocatedOrder(_pOrder, _NewSize) \
  50. { \
  51. unsigned SizeToRemove = (_pOrder)->OrderLength - (_NewSize); \
  52. \
  53. /* Update the next order location, rounding up to the next higher DWORD */ \
  54. /* boundary by rounding down the difference in the old and new sizes. */ \
  55. pddShm->oa.nextOrder -= (SizeToRemove & ~(sizeof(PVOID)-1)); \
  56. \
  57. (_pOrder)->OrderLength = (_NewSize); \
  58. }
  59. #endif // __OADISP_H