Differences
This shows you the differences between two versions of the page.
| en:docs:fapi:dosgetcp [2021/08/20 06:25] – created prokushev | en:docs:fapi:dosgetcp [2021/09/18 11:02] (current) – prokushev | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| {{page> | {{page> | ||
| + | |||
| + | ====== 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> | ||
|   |   | ||
| + | </ | ||
| - | ==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: | + | * 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: | ||
| + | |||
| + |    | ||
| + | *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  | USHORT  | ||
| - | </PRE> | + | </code> | 
| - | ===MASM=== | + | ==== MASM ==== | 
| - | <PRE> | + | |
| + | <code asm> | ||
| EXTRN  DosGetCp: | EXTRN  DosGetCp: | ||
| INCL_DOSNLS  | INCL_DOSNLS  | ||
| 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: | ||
|                 |                 | ||
|                & |                & | ||
| - | </PRE> | + | </code> | 
| + | |||
| + | ===== Related Functions ===== | ||
| - | ==Related Functions== | ||
| *[[DosSetCp]] | *[[DosSetCp]] | ||
| {{page> | {{page> | ||




