1490{
1493 ULONG_PTR DllBase, InitStart, InitEnd, ImageEnd, InitCode;
1499
1500
1502
1503
1505
1506
1514
1515
1518 {
1519
1522
1523
1524
1526 {
1527
1528 NextEntry = NextEntry->
Flink;
1529 continue;
1530 }
1531
1532
1534 if (!NtHeader)
1535 {
1536
1537 NextEntry = NextEntry->
Flink;
1538 continue;
1539 }
1540
1541
1544 InitStart = 0;
1545 while (SectionCount > 0)
1546 {
1547
1549
1550
1553 {
1554
1556 InitSection = Section;
1557 }
1558
1559 if (InitFound)
1560 {
1561
1563
1564
1566
1567
1570
1571
1574
1575
1576 if (SectionCount == 1)
1577 {
1578
1579 LastSection = Section;
1580 }
1581 else
1582 {
1583
1585 do
1586 {
1587
1588 SectionCount--;
1589 Section++;
1591 {
1592
1593 LastSection = Section;
1594 }
1595 else
1596 {
1597
1598 break;
1599 }
1600 }
1601 while (SectionCount > 1);
1602 }
1603
1604
1605 if (LastSection)
1606 {
1607
1609
1610
1612
1613
1614 if (SectionCount != 1)
1615 {
1616
1619 }
1620 }
1621
1622
1625
1626
1627 if (InitStart < InitEnd)
1628 {
1629
1630 if ((InitCode >= InitStart) && (InitCode < InitEnd))
1631 {
1632
1634 *StartVa = (
PVOID)InitStart;
1635 *EndVa = (
PVOID)InitEnd;
1636 }
1637 else
1638 {
1639
1641 DPRINT(
"Freeing init code: %p-%p ('%wZ' @%p : '%s')\n",
1648 }
1649 }
1650 }
1651
1652
1653 SectionCount--;
1654 Section++;
1655 }
1656
1657
1658 NextEntry = NextEntry->
Flink;
1659 }
1660
1661
1665}
#define ALIGN_DOWN_BY(size, align)
#define ALIGN_UP_BY(size, align)
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
#define ExAcquireResourceExclusiveLite(res, wait)
union Alignment_ Alignment
#define KeLeaveCriticalRegion()
#define KeEnterCriticalRegion()
FORCEINLINE BOOLEAN MI_IS_PHYSICAL_ADDRESS(IN PVOID Address)
#define DBG_UNREFERENCED_LOCAL_VARIABLE(L)
#define IMAGE_FIRST_SECTION(NtHeader)
#define IMAGE_SCN_MEM_DISCARDABLE
VOID FASTCALL ExReleaseResourceLite(IN PERESOURCE Resource)
LONG NTAPI KeReleaseMutant(IN PKMUTANT Mutant, IN KPRIORITY Increment, IN BOOLEAN Abandon, IN BOOLEAN Wait)
UNICODE_STRING BaseDllName
struct _LIST_ENTRY * Flink
LIST_ENTRY PsLoadedModuleList
ERESOURCE PsLoadedModuleResource
VOID NTAPI MiFindInitializationCode(OUT PVOID *StartVa, OUT PVOID *EndVa)
VOID NTAPI MiFreeInitializationCode(IN PVOID InitStart, IN PVOID InitEnd)
#define CONTAINING_RECORD(address, type, field)
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size