/* This example queries and displays the maximum length for a path name and the total amount of physical memory in bytes. */ #define INCL_DOSMISC /* DOS Miscellaneous values */ #define INCL_DOSERRORS /* DOS Error values */ #include #include int Max_QSV = 0; int main(VOID) { ULONG aulSysInfo[QSV_MAX+32] = {0}; /* System Information Data Buffer */ APIRET rc = NO_ERROR; /* Return code */ int i; for(i = QSV_MAX+32; i > 0; i--) { rc = DosQuerySysInfo(1L, /* Request all available system */ i, /* information */ (PVOID)aulSysInfo, sizeof(ULONG)*(i)); if (rc != NO_ERROR) { if(rc == ERROR_INVALID_PARAMETER) continue; printf("DosQuerySysInfo error: return code = %u\n", rc); return 1; } Max_QSV = i; break; } printf("Max_QSV=%i\n",Max_QSV); printf(" 1 Maximum length for a path name is %u characters.\n", aulSysInfo[QSV_MAX_PATH_LENGTH-1]); /* Max length of path name */ printf(" 2 Maximum number of text sessions\t %u\n", aulSysInfo[QSV_MAX_TEXT_SESSIONS-1]); printf(" 3 Maximum number of PM sessions \t %u\n", aulSysInfo[QSV_MAX_PM_SESSIONS-1]); printf(" 4 Maximum number of DOS sessions \t %u\n", aulSysInfo[QSV_MAX_VDM_SESSIONS-1]); printf(" 5 Boot drive (1 means A, 2 - B,) \t %u\n", aulSysInfo[QSV_BOOT_DRIVE-1]); printf(" 6 Dynamic priority variation flag\t %u\n", aulSysInfo[QSV_DYN_PRI_VARIATION-1]); printf(" 7 Maximum wait in seconds\t\t %u\n", aulSysInfo[QSV_MAX_WAIT -1]); printf(" 8 Minimum time slice in millisec \t %u\n", aulSysInfo[QSV_MIN_SLICE-1]); printf(" 9 Maximum time slice in millisec \t %u\n", aulSysInfo[QSV_MAX_SLICE-1]); printf("10 Memory page size in bytes \t %u\n", aulSysInfo[QSV_PAGE_SIZE-1]); printf("11 Major version number \t %u\n", aulSysInfo[QSV_VERSION_MAJOR -1]); printf("12 Minor version number \t %u\n", aulSysInfo[QSV_VERSION_MINOR -1]); printf("13 Revision number \t %u\n", aulSysInfo[QSV_VERSION_REVISION -1]); printf("14 Value of a 32-bit, millisecond counter %u\n", aulSysInfo[QSV_MS_COUNT -1]); printf("15 Low-order 32 bits of the time in seconds since January 1, 1970 %u\n", aulSysInfo[QSV_TIME_LOW -1]); printf("16 Hihg-order 32 bits of the time in seconds since January 1, 1970 %u\n", aulSysInfo[QSV_TIME_HIGH -1]); printf("17 Total physical memory in bytes \t %u\n", aulSysInfo[QSV_TOTPHYSMEM -1]); printf("18 Total resident memory in bytes \t %u\n", aulSysInfo[QSV_TOTRESMEM -1]); printf("19 Maximum number of bytes of memory that can\n" " be allocated by all processes in the system %u\n", aulSysInfo[QSV_TOTAVAILMEM -1]); printf("20 Maximum number of bytes of memory that this\n" " process can allocate in its private arena. %u\n", aulSysInfo[QSV_MAXPRMEM -1]); printf("21 Maximum number of bytes of memory that a process\n" " can allocate in the shared arena.\t%u\n", aulSysInfo[QSV_MAXSHMEM -1]); printf("22 Timer interval in tenths of a millisecond %u\n", aulSysInfo[QSV_TIMER_INTERVAL -1]); printf("23 Maximum length, of one component in a path name %u\n", aulSysInfo[QSV_MAX_COMP_LENGTH -1]); printf("24 Session ID of the current foreground full-screen session %u\n", aulSysInfo[QSV_FOREGROUND_FS_SESSION -1]); printf("25 Process ID of the current foreground process %u\n", aulSysInfo[QSV_FOREGROUND_PROCESS -1]); printf("26 Number of processors in the machine \t%u\n", aulSysInfo[QSV_NUMPROCESSORS -1]); if(Max_QSV >= 27) printf("27 Maximum amount of free space in process's high private arena\t%u\n", aulSysInfo[QSV_MAXHPRMEM -1]); if(Max_QSV >= 28) printf("28 Maximum amount of free space in process's high shared arena\t%u\n", aulSysInfo[QSV_MAXHSHMEM -1]); if(Max_QSV >= 29) printf("29 Maximum number of concurrent processes supported \t%u\n", aulSysInfo[QSV_MAXPROCESSES -1]); if(Max_QSV >= 30) printf("30 Size of the user's address space in megabytes \t%u\n", aulSysInfo[QSV_VIRTUALADDRESSLIMIT -1]); if(Max_QSV >= 31) printf("31 INT10ENABLED \t%u\n", aulSysInfo[QSV_INT10ENABLED -1]); for(i=32; i<= Max_QSV; i++) { printf("%i Secret par \t%u\n", i, aulSysInfo[i -1]); } return NO_ERROR; }