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
1.4 KiB

  1. //
  2. // owner.c : this code manipulates the SBR records for keeping track of
  3. // what SBR file owns a particular DEF/REF
  4. //
  5. #include "mbrmake.h"
  6. VA near vaRootSbr; // head of SBR list
  7. VA near vaTailSbr; // tail of SBR list
  8. WORD near SbrCnt; // count of sbr files
  9. VA
  10. VaSbrAdd(WORD fUpdate, LSZ lszName)
  11. // add a new sbr entry to the list -- we promise that cSBR will be the
  12. // setup for the newly added vaSbr
  13. //
  14. {
  15. WORD cb;
  16. VA vaSbr;
  17. vaSbr = vaRootSbr;
  18. while (vaSbr) {
  19. gSBR(vaSbr);
  20. if (strcmpi(cSBR.szName, lszName) == 0) {
  21. cSBR.fUpdate |= fUpdate;
  22. pSBR(vaSbr);
  23. return vaSbr;
  24. }
  25. vaSbr = cSBR.vaNextSbr;
  26. }
  27. cb = strlen(lszName);
  28. vaSbr = VaAllocGrpCb(grpSbr, sizeof(SBR) + cb);
  29. gSBR(vaSbr);
  30. cSBR.vaNextSbr = vaNil;
  31. cSBR.fUpdate |= fUpdate;
  32. cSBR.isbr = -1;
  33. strcpy(cSBR.szName, lszName);
  34. pSBR(vaSbr);
  35. if (vaTailSbr) {
  36. gSBR(vaTailSbr);
  37. cSBR.vaNextSbr = vaSbr;
  38. pSBR(vaTailSbr);
  39. }
  40. else
  41. vaRootSbr = vaSbr;
  42. vaTailSbr = vaSbr;
  43. gSBR(vaSbr);
  44. SbrCnt++;
  45. return vaSbr;
  46. }
  47. VA
  48. VaSbrFrName(LSZ lszName)
  49. // find the .sbr entry matching the given name
  50. //
  51. {
  52. VA vaSbr;
  53. vaSbr = vaRootSbr;
  54. while (vaSbr) {
  55. gSBR(vaSbr);
  56. if (strcmp(cSBR.szName, lszName) == 0)
  57. return vaSbr;
  58. vaSbr = cSBR.vaNextSbr;
  59. }
  60. return vaNil;
  61. }