| | 1552 | |
|---|
| | 1553 | /** |
|---|
| | 1554 | * Guest OS digger interface identifier. |
|---|
| | 1555 | * |
|---|
| | 1556 | * This is for use together with PDBGFR3QueryInterface and is used to |
|---|
| | 1557 | * obtain access to optional interfaces. |
|---|
| | 1558 | */ |
|---|
| | 1559 | typedef enum DBGFOSINTERFACE |
|---|
| | 1560 | { |
|---|
| | 1561 | /** The usual invalid entry. */ |
|---|
| | 1562 | DBGFOSINTERFACE_INVALID = 0, |
|---|
| | 1563 | /** Process info. */ |
|---|
| | 1564 | DBGFOSINTERFACE_PROCESS, |
|---|
| | 1565 | /** Thread info. */ |
|---|
| | 1566 | DBGFOSINTERFACE_THREAD, |
|---|
| | 1567 | /** The end of the valid entries. */ |
|---|
| | 1568 | DBGFOSINTERFACE_END, |
|---|
| | 1569 | /** The usual 32-bit type blowup. */ |
|---|
| | 1570 | DBGFOSINTERFACE_32BIT_HACK = 0x7fffffff |
|---|
| | 1571 | } DBGFOSINTERFACE; |
|---|
| | 1572 | /** Pointer to a Guest OS digger interface identifier. */ |
|---|
| | 1573 | typedef DBGFOSINTERFACE *PDBGFOSINTERFACE; |
|---|
| | 1574 | /** Pointer to a const Guest OS digger interface identifier. */ |
|---|
| | 1575 | typedef DBGFOSINTERFACE const *PCDBGFOSINTERFACE; |
|---|
| | 1576 | |
|---|
| | 1577 | |
|---|
| | 1578 | /** |
|---|
| | 1579 | * Guest OS Digger Registration Record. |
|---|
| | 1580 | * |
|---|
| | 1581 | * This is used with the DBGFR3OSRegister() API. |
|---|
| | 1582 | */ |
|---|
| | 1583 | typedef struct DBGFOSREG |
|---|
| | 1584 | { |
|---|
| | 1585 | /** Magic value (DBGFOSREG_MAGIC). */ |
|---|
| | 1586 | uint32_t u32Magic; |
|---|
| | 1587 | /** Flags. Reserved. */ |
|---|
| | 1588 | uint32_t fFlags; |
|---|
| | 1589 | /** The size of the instance data. */ |
|---|
| | 1590 | uint32_t cbData; |
|---|
| | 1591 | /** Operative System name. */ |
|---|
| | 1592 | char szName[24]; |
|---|
| | 1593 | |
|---|
| | 1594 | /** |
|---|
| | 1595 | * Constructs the instance. |
|---|
| | 1596 | * |
|---|
| | 1597 | * @returns VBox status code. |
|---|
| | 1598 | * @param pVM Pointer to the shared VM structure. |
|---|
| | 1599 | * @param pvData Pointer to the instance data. |
|---|
| | 1600 | */ |
|---|
| | 1601 | DECLCALLBACKMEMBER(int, pfnConstruct)(PVM pVM, void *pvData); |
|---|
| | 1602 | |
|---|
| | 1603 | /** |
|---|
| | 1604 | * Destroys the instance. |
|---|
| | 1605 | * |
|---|
| | 1606 | * @param pVM Pointer to the shared VM structure. |
|---|
| | 1607 | * @param pvData Pointer to the instance data. |
|---|
| | 1608 | */ |
|---|
| | 1609 | DECLCALLBACKMEMBER(void, pfnDestruct)(PVM pVM, void *pvData); |
|---|
| | 1610 | |
|---|
| | 1611 | /** |
|---|
| | 1612 | * Probes the guest memory for OS finger prints. |
|---|
| | 1613 | * |
|---|
| | 1614 | * No setup or so is performed, it will be followed by a call to pfnInit |
|---|
| | 1615 | * or pfnRefresh that should take care of that. |
|---|
| | 1616 | * |
|---|
| | 1617 | * @returns true if is an OS handled by this module, otherwise false. |
|---|
| | 1618 | * @param pVM Pointer to the shared VM structure. |
|---|
| | 1619 | * @param pvData Pointer to the instance data. |
|---|
| | 1620 | */ |
|---|
| | 1621 | DECLCALLBACKMEMBER(bool, pfnProbe)(PVM pVM, void *pvData); |
|---|
| | 1622 | |
|---|
| | 1623 | /** |
|---|
| | 1624 | * Initializes a fresly detected guest, loading symbols and such useful stuff. |
|---|
| | 1625 | * |
|---|
| | 1626 | * This is called after pfnProbe. |
|---|
| | 1627 | * |
|---|
| | 1628 | * @returns VBox status code. |
|---|
| | 1629 | * @param pVM Pointer to the shared VM structure. |
|---|
| | 1630 | * @param pvData Pointer to the instance data. |
|---|
| | 1631 | */ |
|---|
| | 1632 | DECLCALLBACKMEMBER(int, pfnInit)(PVM pVM, void *pvData); |
|---|
| | 1633 | |
|---|
| | 1634 | /** |
|---|
| | 1635 | * Refreshes symbols and stuff following a redetection of the same OS. |
|---|
| | 1636 | * |
|---|
| | 1637 | * This is called after pfnProbe. |
|---|
| | 1638 | * |
|---|
| | 1639 | * @returns VBox status code. |
|---|
| | 1640 | * @param pVM Pointer to the shared VM structure. |
|---|
| | 1641 | * @param pvData Pointer to the instance data. |
|---|
| | 1642 | */ |
|---|
| | 1643 | DECLCALLBACKMEMBER(int, pfnRefresh)(PVM pVM, void *pvData); |
|---|
| | 1644 | |
|---|
| | 1645 | /** |
|---|
| | 1646 | * Terminates an OS when a new (or none) OS has been detected, |
|---|
| | 1647 | * and before destruction. |
|---|
| | 1648 | * |
|---|
| | 1649 | * This is called after pfnProbe and if needed before pfnDestruct. |
|---|
| | 1650 | * |
|---|
| | 1651 | * @param pVM Pointer to the shared VM structure. |
|---|
| | 1652 | * @param pvData Pointer to the instance data. |
|---|
| | 1653 | */ |
|---|
| | 1654 | DECLCALLBACKMEMBER(void, pfnTerm)(PVM pVM, void *pvData); |
|---|
| | 1655 | |
|---|
| | 1656 | /** |
|---|
| | 1657 | * Queries the version of the running OS. |
|---|
| | 1658 | * |
|---|
| | 1659 | * This is only called after pfnInit(). |
|---|
| | 1660 | * |
|---|
| | 1661 | * @returns VBox status code. |
|---|
| | 1662 | * @param pVM Pointer to the shared VM structure. |
|---|
| | 1663 | * @param pvData Pointer to the instance data. |
|---|
| | 1664 | * @param pszVersion Where to store the version string. |
|---|
| | 1665 | * @param cchVersion The size of the version string buffer. |
|---|
| | 1666 | */ |
|---|
| | 1667 | DECLCALLBACKMEMBER(int, pfnQueryVersion)(PVM pVM, void *pvData, char *pszVersion, size_t cchVersion); |
|---|
| | 1668 | |
|---|
| | 1669 | /** |
|---|
| | 1670 | * Queries the pointer to a interface. |
|---|
| | 1671 | * |
|---|
| | 1672 | * This is called after pfnProbe. |
|---|
| | 1673 | * |
|---|
| | 1674 | * @returns Pointer to the interface if available, NULL if not available. |
|---|
| | 1675 | * @param pVM Pointer to the shared VM structure. |
|---|
| | 1676 | * @param pvData Pointer to the instance data. |
|---|
| | 1677 | * @param enmIf The interface identifier. |
|---|
| | 1678 | */ |
|---|
| | 1679 | DECLCALLBACKMEMBER(void *, pfnQueryInterface)(PVM pVM, void *pvData, DBGFOSINTERFACE enmIf); |
|---|
| | 1680 | |
|---|
| | 1681 | /** Trailing magic (DBGFOSREG_MAGIC). */ |
|---|
| | 1682 | uint32_t u32EndMagic; |
|---|
| | 1683 | } DBGFOSREG; |
|---|
| | 1684 | /** Pointer to a Guest OS digger registration record. */ |
|---|
| | 1685 | typedef DBGFOSREG *PDBGFOSREG; |
|---|
| | 1686 | /** Pointer to a const Guest OS digger registration record. */ |
|---|
| | 1687 | typedef DBGFOSREG const *PCDBGFOSREG; |
|---|
| | 1688 | |
|---|
| | 1689 | /** Magic value for DBGFOSREG::u32Magic and DBGFOSREG::u32EndMagic. (Hitomi Kanehara) */ |
|---|
| | 1690 | #define DBGFOSREG_MAGIC 0x19830808 |
|---|
| | 1691 | |
|---|
| | 1692 | DBGFR3DECL(int) DBGFR3OSRegister(PVM pVM, PDBGFOSREG pReg); |
|---|
| | 1693 | DBGFR3DECL(int) DBGFR3OSDeregister(PVM pVM, PDBGFOSREG pReg); |
|---|
| | 1694 | DBGFR3DECL(int) DBGFR3OSDetect(PVM pVM, char *pszName, size_t cchName); |
|---|
| | 1695 | DBGFR3DECL(int) DBGFR3OSNameAndVersion(PVM pVM, char *pszName, size_t cchName, char *pszVersion, size_t cchVersion); |
|---|
| | 1696 | DBGFR3DECL(void *) DBGFR3OSQueryInterface(PVM pVM, DBGFOSINTERFACE enmIf); |
|---|
| | 1697 | |
|---|