en:docs:fapi:doschdir

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

en:docs:fapi:doschdir [2018/08/26 15:28]
prokushev created
en:docs:fapi:doschdir [2018/09/02 05:51] (current)
prokushev
Line 5: Line 5:
  
 ==Syntax== ==Syntax==
- ​DosChDir (DirName, Reserved)+ 
 +  ​DosChDir (DirName, Reserved)
  
 ==Parameters== ==Parameters==
-;DirName (PSZ) - input : Address of the ASCIIZ directory path name. + 
-;Reserved (ULONG) - input : Reserved and must be set to zero.+  *DirName (PSZ) - input : Address of the ASCIIZ directory path name. 
 +  *Reserved (ULONG) - input : Reserved and must be set to zero.
  
 ==Return Code== ==Return Code==
- rc (USHORT) - return+ 
 +  rc (USHORT) - return 
 Return code descriptions are: Return code descriptions are:
-* 0  NO_ERROR +  ​* 0  NO_ERROR 
-* 2  ERROR_FILE_NOT_FOUND  +  * 2  ERROR_FILE_NOT_FOUND  
-* 3  ERROR_PATH_NOT_FOUND +  * 3  ERROR_PATH_NOT_FOUND 
-* 5  ERROR_ACCESS_DENIED +  * 5  ERROR_ACCESS_DENIED 
-* 8  ERROR_NOT_ENOUGH_MEMORY  +  * 8  ERROR_NOT_ENOUGH_MEMORY  
-* 26  ERROR_NOT_DOS_DISK +  * 26  ERROR_NOT_DOS_DISK 
-* 87  ERROR_INVALID_PARAMETER +  * 87  ERROR_INVALID_PARAMETER 
-* 108  ERROR_DRIVE_LOCKED +  * 108  ERROR_DRIVE_LOCKED 
-* 206  ERROR_FILENAME_EXCED_RANGE+  * 206  ERROR_FILENAME_EXCED_RANGE
  
 ==Remarks== ==Remarks==
 +
 The directory path is not changed if any member of the path does not exist. The current directory changes only for the requesting process. The directory path is not changed if any member of the path does not exist. The current directory changes only for the requesting process.
  
Line 35: Line 40:
 ==Example Code== ==Example Code==
 ===C Binding=== ===C Binding===
-<PRE> 
-#define INCL_DOSFILEMGR 
  
-USHORT ​ rc = DosChDir(DirName,​ Reserved);​ +  #define INCL_DOSFILEMGR 
- +   
-PSZ              DirName; ​      /* Directory path name * +  ​USHORT ​ rc = DosChDir(DirName,​ Reserved);​ 
-ULONG            0;             /* Reserved (must be zero) */ +   
- +  PSZ              DirName; ​      /* Directory path name * 
-USHORT ​          ​rc; ​           /* return code */ +  ULONG            0;             /* Reserved (must be zero) */ 
-</​PRE>​+   
 +  USHORT ​          ​rc; ​           /* return code */
  
 This example changes directories to \os2\system. ​ This example changes directories to \os2\system. ​
-<PRE> 
-#define INCL_DOSFILEMGR 
- 
-#define PATH "​\\os2\\system"​ 
-#define RESERVED 0L 
  
-USHORT rc;+  #define INCL_DOSFILEMGR 
 +   
 +  #define PATH "​\\os2\\system"​ 
 +  #define RESERVED 0L 
 +   
 +  ​USHORT rc
 +   
 +     rc = DosChDir(PATH,​ RESERVED);
  
-   rc = DosChDir(PATH,​ RESERVED); 
-</​PRE>​ 
 ===MASM Binding=== ===MASM Binding===
-<PRE> 
-EXTRN  DosChDir:​FAR 
-INCL_DOSFILEMGR ​    EQU 1 
  
-PUSH@  ASCIIZ ​ DirName ​      ;​Directory path name string +  EXTRN  DosChDir:​FAR 
-PUSH   ​DWORD ​  ​0 ​            ;​Reserved (must be zero) +  INCL_DOSFILEMGR ​    EQU 1 
-CALL   ​DosChDir+   
 +  ​PUSH@  ASCIIZ ​ DirName ​      ;​Directory path name string 
 +  PUSH   ​DWORD ​  ​0 ​            ;​Reserved (must be zero) 
 +  CALL   ​DosChDir
  
 Returns WORD Returns WORD
-</​PRE>​ 
  
 === Note === === Note ===

en/docs/fapi/doschdir.txt · Last modified: 2018/09/02 05:51 by prokushev