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.

70 lines
1.5 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. browslst.c
  5. Abstract:
  6. This module contains the worker routines for managing browse lists
  7. for the browser service
  8. Author:
  9. Larry Osterman (larryo) 25-Mar-1992
  10. Revision History:
  11. --*/
  12. #include "precomp.h"
  13. #pragma hdrstop
  14. //-------------------------------------------------------------------//
  15. // //
  16. // Local function prototypes //
  17. // //
  18. //-------------------------------------------------------------------//
  19. RTL_GENERIC_COMPARE_RESULTS
  20. BrCompareBrowseEntry(
  21. PRTL_GENERIC_TABLE Table,
  22. PVOID FirstStruct,
  23. PVOID SecondStruct
  24. )
  25. {
  26. PDOMAIN_ENTRY Entry1 = FirstStruct;
  27. PDOMAIN_ENTRY Entry2 = SecondStruct;
  28. LONG CompareResult;
  29. if ((CompareResult = RtlCompareUnicodeString(Entry1->HostName, Entry2->HostName, TRUE) == 0) {
  30. return GenericEqual;
  31. } else if (CompareResult < 0) {
  32. return GenericLessThan;
  33. } else {
  34. return GenericGreaterThan;
  35. }
  36. }
  37. PVOID
  38. BrAllocateBrowseEntry(
  39. PRTL_GENERIC_TABLE Table,
  40. CLONG ByteSize
  41. )
  42. {
  43. return((PVOID) MIDL_user_allocate(LMEM_ZEROINIT, (UINT) ByteSize+sizeof(BROWSE_ENTRY)));
  44. }
  45. PVOID
  46. BrFreeBrowseEntry(
  47. PRTL_GENERIC_TABLE Table,
  48. CLONG ByteSize
  49. )
  50. {
  51. return(MIDL_user_free(ByteSize+sizeof(BROWSE_ENTRY)));
  52. }