en:docs:fapi:dosgetcp

Differences

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

Link to this comparison view

en:docs:fapi:dosgetcp [2021/08/20 06:25] – created prokusheven:docs:fapi:dosgetcp [2021/09/18 11:02] (current) prokushev
Line 1: Line 1:
 {{page>en:templates:fapiint}} {{page>en:templates:fapiint}}
 +
 +====== DosGetCp ======
  
 This call allows a process to query the current process code page and the prepared system code pages. This call allows a process to query the current process code page and the prepared system code pages.
  
-==Syntax==+===== Syntax ===== 
 + 
 +<code c>
  DosGetCp (Length, CodePageList, DataLength)  DosGetCp (Length, CodePageList, DataLength)
 +</code>
  
-==Parameters== +===== Parameters =====
-;Length (USHORT) - input : Length, in bytes, of CodePageList. This length should be at least 2 bytes. If the length is less than the bytes needed to return all the prepared system code pages than the returned CodePageList is truncated. +
-; CodePageList (PUSHORT) - output : Address of the list of available system code pages. The format of the information returned in this list is: +
-::1 - Current code page identifier +
-::2 - The first prepared code page +
-::3 - The second prepared code page +
-::N - Other prepared system code pages. +
-; DataLength (PUSHORT) - output : Address of the length, in bytes, of the returned data.+
  
-==Return Code== +  * Length (USHORT) - input : Length, in bytes, of CodePageList. This length should be at least 2 bytes. If the length is less than the bytes needed to return all the prepared system code pages than the returned CodePageList is truncated. 
-;rc (USHORT) - return:Return code descriptions are: +  * CodePageList (PUSHORT) - output : Address of the list of available system code pages. The format of the information returned in this list is: 
-*0 NO_ERROR +    * 1 - Current code page identifier 
-*473 ERROR_CPLIST_TOO_SMALL+    * 2 - The first prepared code page 
 +    * 3 - The second prepared code page 
 +    * N - Other prepared system code pages. 
 +  * DataLength (PUSHORT) - output : Address of the length, in bytes, of the returned data. 
 + 
 +===== Return Code ===== 
 + 
 +rc (USHORT) - return:Return code 
 + 
 +  *0 NO_ERROR 
 +  *473 ERROR_CPLIST_TOO_SMALL 
 + 
 +===== Remarks =====
  
-==Remarks== 
 If the process code page identifier was previously set by [[DosSetCp]] or inherited by a process, it is returned to the caller. If the process code page identifier was previously set by [[DosSetCp]] or inherited by a process, it is returned to the caller.
  
Line 27: Line 36:
 If no codepages were prepared with the CODEPAGE command, a length of two and current codepage identifier value of zero is returned.  If no codepages were prepared with the CODEPAGE command, a length of two and current codepage identifier value of zero is returned. 
  
-===Family API Considerations===+==== Family API Considerations ===
 Some options operate differently in the DOS mode than in OS/2 mode. Therefore, the following restriction applies to DosGetCp when coding for the DOS mode: Some options operate differently in the DOS mode than in OS/2 mode. Therefore, the following restriction applies to DosGetCp when coding for the DOS mode:
  
 The current process code page, and no more than one prepared system code page, is returned.  The current process code page, and no more than one prepared system code page, is returned. 
  
-==Bindings== +===== Bindings ===== 
-===C=== + 
-<PRE>+==== C ===
 + 
 +<code c>
 #define INCL_DOSNLS #define INCL_DOSNLS
  
Line 44: Line 56:
  
 USHORT           rc;            /* return code */ USHORT           rc;            /* return code */
-</PRE>+</code>
  
-===MASM=== +==== MASM ===
-<PRE>+ 
 +<code asm>
 EXTRN  DosGetCp:FAR EXTRN  DosGetCp:FAR
 INCL_DOSNLS         EQU 1 INCL_DOSNLS         EQU 1
Line 57: Line 70:
  
 Returns WORD Returns WORD
-</PRE>+</code> 
 + 
 +===== Example =====
  
-==Example== 
 This example gets the current code page and then up to 3 other prepared codepages. This example gets the current code page and then up to 3 other prepared codepages.
-<PRE>+<code c>
 #define INCL_DOSNLS #define INCL_DOSNLS
  
Line 71: Line 85:
                CpList,           /* List */                CpList,           /* List */
                &CpSize);         /* Length of returned list */                &CpSize);         /* Length of returned list */
-</PRE>+</code> 
 + 
 +===== Related Functions =====
  
-==Related Functions== 
 *[[DosSetCp]] *[[DosSetCp]]
  
 {{page>en:templates:fapi}} {{page>en:templates:fapi}}