Jump to content

DosQueryCurrentDisk: Difference between revisions

From EDM2
Line 45: Line 45:
===See Also===
===See Also===


[[OS2 API:CPI:DosSetDefaultDisk|DosSetDefaultDisk]]
* [[OS2 API:CPI:DosSetDefaultDisk|DosSetDefaultDisk]]


[[Category:The OS/2 API Project]]
[[Category:The OS/2 API Project]]

Revision as of 18:52, 9 June 2016

DosQueryCurrentDisk

Syntax

rc = DosQueryCurrentDisk( pulDrive, pulLogical );

Parameters

PULONG pulDrive (output)
Pointer to the current drive number. (1=A, 2=B etc.)
PULONG pulLogical (output)
Pointer to a 32-bit bit area where each of the 26 lowest bits represents a drive (0=A, 1=B etc.) If bit n is set(=1) then the drive corresponding to n exists.

Returns

APIRET rc
0 NO_ERROR

Include Info

#define INCL_DOSFILEMGR
#include <os2.h>

Usage Explanation

DosQueryCurrentDisk is used to query which drive is the current default drive for the process and to get the drives available.

Relevant Structures

Gotchas

Sample Code

#define INCL_DOSFILEMGR
#include <os2.h>
#include <stdio.h>   /* For printf */

ULONG ulDrive;
ULONG ulLogical;
APIRET rc;

rc=DosQueryCurrentDisk(&ulDrive, &ulLogical);         /* Get current drive   */
printf("Current Drive is %c.\n",(char)ulDrive+'A'-1); /* Print current drive */

See Also