delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/05/01/10:31:22

Message-ID: <354AB827.8EE19C9D@mailexcite.com>
Date: Fri, 01 May 1998 23:07:35 -0700
From: WT <gnatwt AT mailexcite DOT com>
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Problem with integer declaration?
NNTP-Posting-Host: 203.116.121.44
Lines: 33
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

I am trying to write a short program to detect VESA VBE and output
information about the video card. I declared a struct of 512 bytes to be
used as a buffer for vbe_info_block. The strange thing is that when I
printed sizeof(vbe_info_block) it gave me 516 bytes instead of 512. I am
sure my struct is correct because I've checked it many times. This is
how the struct is declared :

typedef
  struct {
    unsigned int vbe_signature; /* VBE Signature */
    unsigned short vbe_version; /* VBE Version */
    unsigned int oem_string_ptr; /* Pointer to OEM info */
    unsigned int capabilities; /* Capabilities of graphics controller */

    unsigned int video_mode_ptr; /* Pointer to VideoModeList */
    unsigned short total_memory; /* Number of 64kb memory blocks */
    /* Added for VBE 2.0 */
    unsigned short oem_software_rev; /* VBE implementation Software
revision */
    unsigned int oem_vendor_name_ptr; /* Pointer to Vendor Name String
*/
    unsigned int oem_product_name_ptr; /* Pointer to Product Name String
*/
    unsigned int oem_product_rev_ptr; /* Pointer to Product Revision
String */
    unsigned char reserved[222]; /* Reserved for VBE implementation
scratch area */
    unsigned char oem_data[256]; /* Data Area for OEM Strings */
  } vbe_info_block;


Could it be something wrong with the int declaration? Please help!

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019