Windows NT 4.0 source code leak
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.

146 lines
2.4 KiB

4 years ago
  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. rpcuuid.hxx
  5. Abstract:
  6. We provide a class which is wrapped around UUIDs in this file.
  7. This class will be used internally by the runtime to deal with
  8. UUIDs.
  9. Author:
  10. Michael Montague (mikemon) 15-Nov-1991
  11. Revision History:
  12. Danny Glasser (dannygl) 03-Mar-1992
  13. Created worker functions for IsNullUuid, CopyUuid, and
  14. ConvertToString. This is necessary for medium-model
  15. (i.e. Win16) support, because the Glock C++ translator
  16. doesn't support far "this" pointers.
  17. Danny Glasser (dannygl) 07-Mar-1992
  18. Same as above for ConvertFromString.
  19. Michael Montague (mikemon) 30-Nov-1992
  20. Remove the I_ routines.
  21. --*/
  22. #ifndef __RPCUUID_HXX__
  23. #define __RPCUUID_HXX__
  24. #ifdef WIN
  25. class __far RPC_UUID
  26. #else // WIN
  27. class RPC_UUID
  28. #endif // WIN
  29. /*++
  30. Class Description:
  31. This class is simply a wrapper around the UUID data structure.
  32. Doing this isolates the rest of the program from the internal
  33. representation of UUIDs.
  34. Fields:
  35. Uuid - Contains the UUID which this class is a wrapper around.
  36. --*/
  37. {
  38. private:
  39. UUID Uuid;
  40. public:
  41. int
  42. ConvertFromString (
  43. IN RPC_CHAR PAPI * String
  44. );
  45. void
  46. SetToNullUuid (
  47. );
  48. unsigned short HashUuid(
  49. );
  50. RPC_CHAR PAPI *
  51. ConvertToString (
  52. OUT RPC_CHAR PAPI * String
  53. );
  54. int
  55. IsNullUuid (
  56. );
  57. void
  58. CopyUuid (
  59. IN RPC_UUID PAPI * FromUuid
  60. );
  61. int
  62. MatchUuid (
  63. IN RPC_UUID PAPI * RpcUuid
  64. );
  65. };
  66. inline int
  67. RPC_UUID::MatchUuid (
  68. IN RPC_UUID PAPI * RpcUuid
  69. )
  70. /*++
  71. Routine Description:
  72. This method compares the supplies UUID against this UUID.
  73. Arguments:
  74. RpcUuid - Supplies the UUID to compare with this UUID.
  75. Return Value:
  76. Zero will be returned if the supplied UUID is the same as this
  77. UUID; otherwise, non-zero will be returned.
  78. --*/
  79. {
  80. return(RpcpMemoryCompare(&(this->Uuid),&(RpcUuid->Uuid),sizeof(UUID)));
  81. }
  82. inline void
  83. RPC_UUID::CopyUuid (
  84. IN RPC_UUID PAPI * FromUuid
  85. )
  86. /*++
  87. Routine Description:
  88. The supplied uuid will be copied into this uuid.
  89. Arguments:
  90. FromUuid - Supplies the uuid to copy from.
  91. --*/
  92. {
  93. RpcpMemoryCopy(&(this->Uuid), &(FromUuid->Uuid), sizeof(UUID));
  94. }
  95. extern "C" void
  96. ByteSwapUuid(
  97. RPC_UUID PAPI *pRpcUuid
  98. );
  99. #endif // __RPCUUID_HXX__