DbiModuleInfo.cs 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. //-----------------------------------------------------------------------------
  2. //
  3. // Copyright (c) Microsoft. All rights reserved.
  4. // This code is licensed under the Microsoft Public License.
  5. // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
  6. // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
  7. // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
  8. // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
  9. //
  10. //-----------------------------------------------------------------------------
  11. using System;
  12. namespace Microsoft.Cci.Pdb {
  13. internal class DbiModuleInfo {
  14. internal DbiModuleInfo(BitAccess bits, bool readStrings) {
  15. bits.ReadInt32(out opened);
  16. new DbiSecCon(bits);
  17. bits.ReadUInt16(out flags);
  18. bits.ReadInt16(out stream);
  19. bits.ReadInt32(out cbSyms);
  20. bits.ReadInt32(out cbOldLines);
  21. bits.ReadInt32(out cbLines);
  22. bits.ReadInt16(out files);
  23. bits.ReadInt16(out pad1);
  24. bits.ReadUInt32(out offsets);
  25. bits.ReadInt32(out niSource);
  26. bits.ReadInt32(out niCompiler);
  27. if (readStrings) {
  28. bits.ReadCString(out moduleName);
  29. bits.ReadCString(out objectName);
  30. } else {
  31. bits.SkipCString(out moduleName);
  32. bits.SkipCString(out objectName);
  33. }
  34. bits.Align(4);
  35. //if (opened != 0 || pad1 != 0) {
  36. // throw new PdbException("Invalid DBI module. "+
  37. // "(opened={0}, pad={1})", opened, pad1);
  38. //}
  39. }
  40. internal int opened; // 0..3
  41. //internal DbiSecCon section; // 4..31
  42. internal ushort flags; // 32..33
  43. internal short stream; // 34..35
  44. internal int cbSyms; // 36..39
  45. internal int cbOldLines; // 40..43
  46. internal int cbLines; // 44..57
  47. internal short files; // 48..49
  48. internal short pad1; // 50..51
  49. internal uint offsets;
  50. internal int niSource;
  51. internal int niCompiler;
  52. internal string moduleName;
  53. internal string objectName;
  54. }
  55. }