Mail Archives: djgpp/1998/01/19/14:15:37
Ross Boast wrote:
>
> Indeed, not as simple as it first seemed, its got me stumped anyhow.
>
> Here's the function:
> __dpmi_get_free_ memory_information(__dpmi_free_mem_info *_info)
>
> And here's the struct which it should fill :
>
> typedef struct {
> unsigned long largest_available_free_block_in_bytes;
> unsigned long maximum_unlocked_page_allocation_in_pages;
> unsigned long maximum_locked_page_allocation_in_pages;
> unsigned long linear_address_space_size_in_pages;
> unsigned long total_number_of_unlocked_pages;
> unsigned long total_number_of_free_pages;
> unsigned long total_number_of_physical_pages;
> unsigned long free_linear_address_space_in_pages;
> unsigned long size_of_paging_file_partition_in_pages;
> unsigned long reserved[3];
> } __dpmi_free_mem_info;
>
> Er help!, i can't use intialize this struct with another variable because
> it says unkown storage calss which is understandable. I can't make a direct
> access to any of the variables in __dpmi_free_mem_info, so basically i'm
> stuck and i haven't got a clue, also let me know if i have to do something
> else due to the fact that its dpmi :). If someone could show me how to use
>
> __dpmi_get_free_ memory_information(__dpmi_free_mem_info *_info)
>
> and printf it i would be grateful!
>
#include <dpmi.h>
#include <stdio.h>
void show_free_mem_info(void)
{
__dpmi_free_mem_info i;
__dpmi_get_free_memory_information(&i);
printf("Largest available free block: %8.8x\n",
i.largest_available_free_block_in_bytes);
...etc ..etc}
return;
}
i would recommend (re-)acquainting yourself with the basics of accessing
structure members in C. or maybe change "Boast" to something else...
-- Sinan
- Raw text -