📄 pm.c
字号:
PM_backslash(path); strcat(path,"config"); return path;}/****************************************************************************REMARKS:Return a unique identifier for the machine if possible.****************************************************************************/const char * PMAPI PM_getUniqueID(void){ return PM_getMachineName();}/****************************************************************************REMARKS:Get the name of the machine on the network.****************************************************************************/const char * PMAPI PM_getMachineName(void){ static char name[256]; if (REG_queryString(szMachineNameKey,szMachineName,name,sizeof(name))) return name; if (REG_queryString(szMachineNameKeyNT,szMachineName,name,sizeof(name))) return name; return "Unknown";}/****************************************************************************REMARKS:Check if a key has been pressed.****************************************************************************/int PMAPI PM_kbhit(void){ // Not used in NT drivers return true;}/****************************************************************************REMARKS:Wait for and return the next keypress.****************************************************************************/int PMAPI PM_getch(void){ // Not used in NT drivers return 0xD;}/****************************************************************************REMARKS:Open a console for output to the screen, creating the main event handlingwindow if necessary.****************************************************************************/PM_HWND PMAPI PM_openConsole( PM_HWND hwndUser, int device, int xRes, int yRes, int bpp, ibool fullScreen){ // Not used in NT drivers (void)hwndUser; (void)device; (void)xRes; (void)yRes; (void)bpp; (void)fullScreen; return NULL;}/****************************************************************************REMARKS:Find the size of the console state buffer.****************************************************************************/int PMAPI PM_getConsoleStateSize(void){ // Not used in NT drivers return 1;}/****************************************************************************REMARKS:Save the state of the console.****************************************************************************/void PMAPI PM_saveConsoleState( void *stateBuf, PM_HWND hwndConsole){ // Not used in NT drivers (void)stateBuf; (void)hwndConsole;}/****************************************************************************REMARKS:Set the suspend application callback for the fullscreen console.****************************************************************************/void PMAPI PM_setSuspendAppCallback( PM_saveState_cb saveState){ // Not used in NT drivers (void)saveState;}/****************************************************************************REMARKS:Restore the console state.****************************************************************************/void PMAPI PM_restoreConsoleState( const void *stateBuf, PM_HWND hwndConsole){ // Not used in NT drivers (void)stateBuf; (void)hwndConsole;}/****************************************************************************REMARKS:Close the fullscreen console.****************************************************************************/void PMAPI PM_closeConsole( PM_HWND hwndConsole){ // Not used in NT drivers (void)hwndConsole;}/****************************************************************************REMARKS:Set the location of the OS console cursor.****************************************************************************/void PMAPI PM_setOSCursorLocation( int x, int y){ /* Nothing to do for Windows */ (void)x; (void)y;}/****************************************************************************REMARKS:Set the width of the OS console.****************************************************************************/void PMAPI PM_setOSScreenWidth( int width, int height){ /* Nothing to do for Windows */ (void)width; (void)height;}/****************************************************************************REMARKS:Maps a shared memory block into process address space. Does nothing sincethe memory blocks are already globally mapped into all processes.****************************************************************************/void * PMAPI PM_mapToProcess( void *base, ulong limit){ // Not used anymore (void)base; (void)limit; return NULL;}/****************************************************************************REMARKS:Execute the POST on the secondary BIOS for a controller.****************************************************************************/ibool PMAPI PM_doBIOSPOST( ushort axVal, ulong BIOSPhysAddr, void *mappedBIOS, ulong BIOSLen){ // This may not be possible in NT and should be done by the OS anyway (void)axVal; (void)BIOSPhysAddr; (void)mappedBIOS; (void)BIOSLen; return false;}/****************************************************************************REMARKS:Return a pointer to the real mode BIOS data area.****************************************************************************/void * PMAPI PM_getBIOSPointer(void){ // Note that on NT this probably does not do what we expect! return PM_mapPhysicalAddr(0x400, 0x1000, true);}/****************************************************************************REMARKS:Return a pointer to 0xA0000 physical VGA graphics framebuffer.****************************************************************************/void * PMAPI PM_getA0000Pointer(void){ return PM_mapPhysicalAddr(0xA0000,0xFFFF,false);}/****************************************************************************REMARKS:Sleep for the specified number of milliseconds.****************************************************************************/void PMAPI PM_sleep( ulong milliseconds){ // We never use this in NT drivers (void)milliseconds;}/****************************************************************************REMARKS:Return the base I/O port for the specified COM port.****************************************************************************/int PMAPI PM_getCOMPort(int port){ // TODO: Re-code this to determine real values using the Plug and Play // manager for the OS. switch (port) { case 0: return 0x3F8; case 1: return 0x2F8; case 2: return 0x3E8; case 3: return 0x2E8; } return 0;}/****************************************************************************REMARKS:Return the base I/O port for the specified LPT port.****************************************************************************/int PMAPI PM_getLPTPort(int port){ // TODO: Re-code this to determine real values using the Plug and Play // manager for the OS. switch (port) { case 0: return 0x3BC; case 1: return 0x378; case 2: return 0x278; } return 0;}/****************************************************************************REMARKS:Returns available memory. Not possible under Windows.****************************************************************************/void PMAPI PM_availableMemory( ulong *physical, ulong *total){ *physical = *total = 0;}/****************************************************************************REMARKS:OS specific shared libraries not supported inside a VxD****************************************************************************/PM_MODULE PMAPI PM_loadLibrary( const char *szDLLName){ // Not used in NT drivers (void)szDLLName; return NULL;}/****************************************************************************REMARKS:OS specific shared libraries not supported inside a VxD****************************************************************************/void * PMAPI PM_getProcAddress( PM_MODULE hModule, const char *szProcName){ // Not used in NT drivers (void)hModule; (void)szProcName; return NULL;}/****************************************************************************REMARKS:OS specific shared libraries not supported inside a VxD****************************************************************************/void PMAPI PM_freeLibrary( PM_MODULE hModule){ // Not used in NT drivers (void)hModule;}/****************************************************************************REMARKS:Function to find the first file matching a search criteria in a directory.****************************************************************************/void *PMAPI PM_findFirstFile( const char *filename, PM_findData *findData){ // TODO: This function should start a directory enumeration search // given the filename (with wildcards). The data should be // converted and returned in the findData standard form. (void)filename;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -