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.

139 lines
2.5 KiB

  1. /*++
  2. Copyright (C) Microsoft Corporation, 1991 - 1999
  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. RPC_STATUS GenerateRandomNumber(unsigned char *Buffer, int BufferSize);
  25. class RPC_UUID : public UUID
  26. /*++
  27. Class Description:
  28. This class is simply a wrapper around the UUID data structure.
  29. Doing this isolates the rest of the program from the internal
  30. representation of UUIDs.
  31. Fields:
  32. Uuid - Contains the UUID which this class is a wrapper around.
  33. --*/
  34. {
  35. public:
  36. int
  37. ConvertFromString (
  38. IN RPC_CHAR PAPI * String
  39. );
  40. void
  41. SetToNullUuid (
  42. );
  43. unsigned short HashUuid(
  44. );
  45. RPC_CHAR PAPI *
  46. ConvertToString (
  47. OUT RPC_CHAR PAPI * String
  48. );
  49. int
  50. IsNullUuid (
  51. );
  52. void
  53. CopyUuid (
  54. IN RPC_UUID PAPI * FromUuid
  55. );
  56. int
  57. MatchUuid (
  58. IN RPC_UUID PAPI * RpcUuid
  59. );
  60. };
  61. inline int
  62. RPC_UUID::MatchUuid (
  63. IN RPC_UUID PAPI * RpcUuid
  64. )
  65. /*++
  66. Routine Description:
  67. This method compares the supplies UUID against this UUID.
  68. Arguments:
  69. RpcUuid - Supplies the UUID to compare with this UUID.
  70. Return Value:
  71. Zero will be returned if the supplied UUID is the same as this
  72. UUID; otherwise, non-zero will be returned.
  73. --*/
  74. {
  75. return(RpcpMemoryCompare(this, RpcUuid, sizeof(RPC_UUID)));
  76. }
  77. inline void
  78. RPC_UUID::CopyUuid (
  79. IN RPC_UUID PAPI * FromUuid
  80. )
  81. /*++
  82. Routine Description:
  83. The supplied uuid will be copied into this uuid.
  84. Arguments:
  85. FromUuid - Supplies the uuid to copy from.
  86. --*/
  87. {
  88. *this = *FromUuid;
  89. }
  90. extern "C" void
  91. ByteSwapUuid(
  92. RPC_UUID PAPI *pRpcUuid
  93. );
  94. #endif // __RPCUUID_HXX__