1489{
1492 ULONG_PTR DllBase, InitStart, InitEnd, ImageEnd, InitCode;
1498
1499
1501
1502
1504
1505
1513
1514
1517 {
1518
1521
1522
1523
1525 {
1526
1527 NextEntry = NextEntry->
Flink;
1528 continue;
1529 }
1530
1531
1533 if (!NtHeader)
1534 {
1535
1536 NextEntry = NextEntry->
Flink;
1537 continue;
1538 }
1539
1540
1543 InitStart = 0;
1544 while (SectionCount > 0)
1545 {
1546
1548
1549
1552 {
1553
1555 InitSection = Section;
1556 }
1557
1558 if (InitFound)
1559 {
1560
1562
1563
1565
1566
1569
1570
1573
1574
1575 if (SectionCount == 1)
1576 {
1577
1578 LastSection = Section;
1579 }
1580 else
1581 {
1582
1584 do
1585 {
1586
1587 SectionCount--;
1588 Section++;
1590 {
1591
1592 LastSection = Section;
1593 }
1594 else
1595 {
1596
1597 break;
1598 }
1599 }
1600 while (SectionCount > 1);
1601 }
1602
1603
1604 if (LastSection)
1605 {
1606
1608
1609
1611
1612
1613 if (SectionCount != 1)
1614 {
1615
1618 }
1619 }
1620
1621
1624
1625
1626 if (InitStart < InitEnd)
1627 {
1628
1629 if ((InitCode >= InitStart) && (InitCode < InitEnd))
1630 {
1631
1633 *StartVa = (
PVOID)InitStart;
1634 *EndVa = (
PVOID)InitEnd;
1635 }
1636 else
1637 {
1638
1640 DPRINT(
"Freeing init code: %p-%p ('%wZ' @%p : '%s')\n",
1647 }
1648 }
1649 }
1650
1651
1652 SectionCount--;
1653 Section++;
1654 }
1655
1656
1657 NextEntry = NextEntry->
Flink;
1658 }
1659
1660
1664}
#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