Home |
RTTarget-32 Programming Manual Function RTLocateSection Function RTSetDLLNameTranslation System Management BIOS (SMBIOS) Advanced Programmable Interrupt Controller (APIC) |
Function RTLocateSectionRTLocateSection can search for a program entity created by RTLoc's Locate command: const RTAppSection * RTLocateSection(int Index, int Type, const char * Name); ParametersIndexSpecifies the section to select if several sections match the following search criteria. Index is 1-based. TypeMust be one of the following constants:
NameMay either be NULL to match any section, or it must point to the name of the desired section as given in the program configuration file. Name matching is not case-sensitive. return valuePointer to a structure defined in Rttarget.h with the following layout: typedef struct { DWORD Flags; DWORD SectionImageLen; DWORD SectionAllocLen; DWORD SectionAddr; } RTAppSection; SectionAddr is the location of the section in the virtual address space. SectionAllocLen is its size. If initialized data is associated with the section, its size is given in SectionImageLen. For regions, SectionImageLen is the physical size of the region. Thus, this value is always zero for virtual regions and smaller than SectionAllocLen for regions which have been extended with a FillRAM command. If the desired section is not found, RTLocateSection returns NULL. All sections available at run-time are listed in the Relocation Report and Application Image Report of the LOC file created by RTLoc. Example:The following function retrieves a pointer to the page table: RTPageTableEntry * PageTablePtr(void) { const RTAppSection * Section; Section = RTLocateSection(1, RT_ST_PAGETABLE, NULL); if (Section == NULL) // no paging return NULL; else return (RTPageTableEntry*) Section->SectionAddr; } The following code lists all available RAM files on the screen: for (i=1;;i++) { const RTAppSection * Section = RTLocateSection(i, RT_ST_FILEDATA, NULL); if (Section == NULL) break; printf("File name: %s\n", RTSectionName(Section)); }
|