28 ULONG KphpGetKernelRevisionNumber(
35 VS_FIXEDFILEINFO *rootBlock;
36 ULONG rootBlockLength;
44 if (versionInfo && VerQueryValue(versionInfo, L
"\\", &rootBlock, &rootBlockLength) && rootBlockLength != 0)
45 result = rootBlock->dwFileVersionLS & 0xffff;
56 ULONG majorVersion, minorVersion, servicePack, buildNumber;
65 Package->MajorVersion = (USHORT)majorVersion;
66 Package->MinorVersion = (USHORT)minorVersion;
67 Package->ServicePackMajor = (USHORT)servicePack;
68 Package->BuildNumber = -1;
71 if (majorVersion == 6 && minorVersion == 0)
77 Package->StructData.OtName = 0x78;
78 Package->StructData.OtIndex = 0x90;
80 else if (servicePack == 1)
82 Package->StructData.OtName = 0x10;
83 Package->StructData.OtIndex = 0x28;
85 else if (servicePack == 2)
87 Package->StructData.OtName = 0x10;
88 Package->StructData.OtIndex = 0x28;
92 return STATUS_NOT_SUPPORTED;
95 Package->StructData.EgeGuid = 0x14;
96 Package->StructData.EpObjectTable = 0x160;
97 Package->StructData.EpRundownProtect = 0xd8;
98 Package->StructData.EreGuidEntry = 0x10;
101 else if (majorVersion == 6 && minorVersion == 1)
105 if (servicePack == 0)
108 else if (servicePack == 1)
113 return STATUS_NOT_SUPPORTED;
116 Package->StructData.EgeGuid = 0x14;
117 Package->StructData.EpObjectTable = 0x200;
118 Package->StructData.EpRundownProtect = 0x178;
119 Package->StructData.EreGuidEntry = 0x10;
120 Package->StructData.OtName = 0x10;
121 Package->StructData.OtIndex = 0x28;
124 else if (majorVersion == 6 && minorVersion == 2 && buildNumber == 9200)
126 Package->BuildNumber = 9200;
129 Package->StructData.EgeGuid = 0x14;
130 Package->StructData.EpObjectTable = 0x408;
131 Package->StructData.EpRundownProtect = 0x2d8;
132 Package->StructData.EreGuidEntry = 0x10;
133 Package->StructData.HtHandleContentionEvent = 0x30;
134 Package->StructData.OtName = 0x10;
135 Package->StructData.OtIndex = 0x28;
136 Package->StructData.ObDecodeShift = 19;
137 Package->StructData.ObAttributesShift = 20;
140 else if (majorVersion == 6 && minorVersion == 3 && buildNumber == 9600)
142 ULONG revisionNumber = KphpGetKernelRevisionNumber();
144 Package->BuildNumber = 9600;
147 Package->StructData.EgeGuid = 0x18;
148 Package->StructData.EpObjectTable = 0x408;
149 Package->StructData.EpRundownProtect = 0x2d8;
150 Package->StructData.EreGuidEntry = revisionNumber >= 17736 ? 0x20 : 0x10;
151 Package->StructData.HtHandleContentionEvent = 0x30;
152 Package->StructData.OtName = 0x10;
153 Package->StructData.OtIndex = 0x28;
154 Package->StructData.ObDecodeShift = 16;
155 Package->StructData.ObAttributesShift = 17;
159 return STATUS_NOT_SUPPORTED;
162 return STATUS_SUCCESS;
171 ULONG majorVersion, minorVersion, servicePack, buildNumber;
180 Package->MajorVersion = (USHORT)majorVersion;
181 Package->MinorVersion = (USHORT)minorVersion;
182 Package->ServicePackMajor = (USHORT)servicePack;
183 Package->BuildNumber = -1;
187 return STATUS_NOT_SUPPORTED;
190 return STATUS_SUCCESS;