www.delorie.com/djgpp/doc/libc/libc_430.html   search  
libc.a reference

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

_go32_dpmi_allocate_dos_memory

Syntax

 
#include <dpmi.h>

int _go32_dpmi_allocate_dos_memory(_go32_dpmi_seginfo *info);

Description

See section DPMI Overview.

Allocate a part of the conventional memory area (the first 640K). Set the size field of info to the number of paragraphs requested (this is (size in bytes + 15)/16), then call. The rm_segment field of info contains the segment of the allocated memory.

The memory may be resized with _go32_dpmi_resize_dos_memory and must be freed with _go32_dpmi_free_dos_memory.

If there isn't enough memory in the system, the size field of info has the largest available size, and an error is returned.

See also dosmemput, and dosmemget.

Return Value

Zero on success, nonzero on failure.

Portability

ANSI/ISO C No
POSIX No

Example

 
_go32_dpmi_seginfo info;
info.size = (want_size+15) / 16;
_go32_dpmi_allocate_dos_memory(&info);
dosmemput(buffer, want_size, info.rm_segment*16);
_go32_dpmi_free_dos_memory(&info);


  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2004   by DJ Delorie     Updated Apr 2004