@node _go32_info_block, dpmi @vindex _go32_info_block @tindex Go32_Info_Block@r{ type} @subheading Syntax @example #include extern __Go32_Info_Block _go32_info_block; @end example @subheading Description The go32 information block is a mechanism for @file{go32} to pass information to the application. Some of this information is generally useful, such as the pid or the transfer buffer, while some is used internally to @file{libc.a} only. The structure has this format: @example typedef struct @{ unsigned long size_of_this_structure_in_bytes; unsigned long linear_address_of_primary_screen; unsigned long linear_address_of_secondary_screen; unsigned long linear_address_of_transfer_buffer; unsigned long size_of_transfer_buffer; unsigned long pid; unsigned char master_interrupt_controller_base; unsigned char slave_interrupt_controller_base; unsigned short selector_for_linear_memory; unsigned long linear_address_of_stub_info_structure; unsigned long linear_address_of_original_psp; unsigned short run_mode; unsigned short run_mode_info; @} Go32_Info_Block; @end example The linear address fields provide values that are suitable for @code{dosmemget}, @code{dosmemput}, and @code{movedata}. The selector_for_linear_memory is suitable for @code{} selector parameters. Due to the length of these fields, and their popularity, the following macros are available: @table @code @item _dos_ds This expands to _go32_info_block.selector_for_linear_memory @item __tb This expands to _go32_info_block.linear_address_of_transfer_buffer @item __tb_size This expands to _go32_info_block.size_of_transfer_buffer @end table The @code{run_mode} field indicates the mode that the program is running in. The following modes are defined: @table @code @item _GO32_RUN_MODE_UNDEF This indicates that the extender did not (or could not) determine or provide the mode information. The most probable reason is that it's an older extender that does not support this field. The program should not assume anything about the run mode if it is this value. @item _GO32_RUN_MODE_RAW This indicates that no CPU manager is being used, and no XMS manager is present. The CPU is being managed directly from the extender, and memory was allocated from the extended memory pool. @item _GO32_RUN_MODE_XMS This indicates that the extender is managing the CPU, but an XMS driver is managing the memory pool. @item _GO32_RUN_MODE_VCPI This indicates that a VCPI server (like @code{emm386} or @code{qemm}) is managing both the CPU and the memory. @item _GO32_RUN_MODE_DPMI This indicates that a DPMI server (like @code{qdpmi} or Windows) is managing both the CPU and memory. Programs may rely on this value to determine if it is safe to use DPMI 0.9 functions. If this value is set, the @code{run_mode_info} field has the DPMI specification version, in hex, shifted eight bits. For example, DPMI 0.9 has 0x005A in the @code{run_mode_info} field. @end table Note that the program should not assume that the value will be one of the listed values. If the program is running with an extender that provides some other mode (say, a newly released extender) then the program should be able to handle that case gracefully. @subheading Portability @portability !ansi, !posix @subheading Example @example dosmemget(_go32_info_block.linear_address_of_primary_screen, 80*25*2, buf); @end example