DosQuerySysInfo

Returns values of static system variables.

Syntax
rc = DosQuerySysInfo( ulStartIndex, ulLastIndex, pDataBuffer, ulDataBufferLength );

Parameters

 * ULONG ulStartIndex (input): Index of the first info to query.
 * ULONG ulLastIndex (input): Index of the last info to query. Equal to ulStartIndex if it is the only wanted info.
 * PVOID pDataBuffer (output): Address to a data buffer to put the information in.
 * LONG ulDataBufferLength (input): Size of pDataBuffer. Valid values for ulStartIndex and ulLastIndex

Returns

 * APIRET rc
 * Indicates if any error occurred.

Include Info

 * 1) define INCL_DOSMISC
 * 2) include 

Usage Explanation
DosQuerySysInfo queries different information about the system. and returns it in a buffer sent to it with the call.

Sample Code
ULONG aulBuffer[4]; APIRET rc; rc = DosQuerySysInfo(QSV_VERSION_MAJOR, QSV_MS_COUNT, 		    (void *)aulBuffer, 4*sizeof(ULONG)); if(rc) { printf("Error! DosQuerySysInfo returned %d.\n",rc); return(-1); } else { printf("You are running version %d.%d revision %c.\n",          aulBuffer[0], aulBuffer[1], (char) aulBuffer[2]); printf("Your system has been running %d hour(s) and %d minute(s).\n",          aulBuffer[3]/3600000, (aulBuffer[3]%3600000)/60000); }

This example queries and displays the maximum length for a path name and the total amount of physical memory in bytes. 
 * 1) define INCL_DOSMISC      /* DOS Miscellaneous values */
 * 2) define INCL_DOSERRORS    /* DOS Error values         */
 * 3) include 
 * 4) include 

int main(VOID) {

ULONG  aulSysInfo[QSV_MAX] = {0};       /* System Information Data Buffer */ APIRET rc                  = NO_ERROR;  /* Return code                    */

rc = DosQuerySysInfo(1L,                /* Request all available system   */                       QSV_MAX,            /* information                    */                       (PVOID)aulSysInfo,                       sizeof(ULONG)*QSV_MAX);

if (rc != NO_ERROR) { printf("DosQuerySysInfo error: return code = %u\n", rc); return 1; } else { printf("Maximum length for a path name is %u characters.\n",            aulSysInfo[QSV_MAX_PATH_LENGTH-1]);  /* Max length of path name */

printf("Total physical memory is %u bytes.\n",            aulSysInfo[QSV_TOTPHYSMEM-1]);       /* Total physical memory   */ } /* endif */

return NO_ERROR; } 

Related Functions

 * DosCreateDir
 * DosFindFirst
 * DosFindNext
 * DosOpen
 * DosQueryCurrentDir
 * DosQueryFSInfo
 * DosQueryPathInfo
 * DosSearchPath
 * DosSetCurrentDir
 * DosSetPathInfo
 * DosSetFSInfo