Author Topic: MMIOINFO Structure Definition  (Read 3421 times)

dedndave

  • Member
  • *****
  • Posts: 8734
  • Still using Abacus 2.0
    • DednDave
MMIOINFO Structure Definition
« on: January 16, 2013, 06:34:19 AM »
as defined in the current windows.inc file:
Code: [Select]
MMIOINFO STRUCT
  dwFlags       DWORD      ?
  fccIOProc     DWORD      ?
  pIOProc       DWORD      ?
  wErrorRet     DWORD      ?
  htask         DWORD      ?
  cchBuffer     DWORD      ?
  pchBuffer     DWORD      ?
  pchNext       DWORD      ?
  pchEndRead    DWORD      ?
  pchEndWrite   DWORD      ?
  lBufOffset    DWORD      ?
  lDiskOffset   DWORD      ?
  adwInfo       DWORD     3 dup(?)
  dwReserved1   DWORD      ?
  dwReserved2   DWORD      ?
  hmmio         DWORD      ?
MMIOINFO ENDS

as defined on MSDN:
Code: [Select]
typedef struct {
  DWORD      dwFlags;
  FOURCC     fccIOProc;
  LPMMIOPROC pIOProc;
  UINT       wErrorRet;
  HTASK      hTask;
  LONG       cchBuffer;
  HPSTR      pchBuffer;
  HPSTR      pchNext;
  HPSTR      pchEndRead;
  HPSTR      pchEndWrite;
  LONG       lBufOffset;
  LONG       lDiskOffset;
  DWORD      adwInfo[4];
  DWORD      dwReserved1;
  DWORD      dwReserved2;
  HMMIO      hmmio;
} MMIOINFO;

notice the difference in size of the adwInfo array member

jj2007

  • Member
  • *****
  • Posts: 7558
  • Assembler is fun ;-)
    • MasmBasic
Re: MMIOINFO Structure Definition
« Reply #1 on: January 16, 2013, 06:50:57 AM »
mmSystem.h:

typedef struct _MMIOINFO
{
        /* general fields */
        DWORD           dwFlags;        /* general status flags */
        FOURCC          fccIOProc;      /* pointer to I/O procedure */
        LPMMIOPROC      pIOProc;        /* pointer to I/O procedure */
        UINT            wErrorRet;      /* place for error to be returned */
        HTASK           htask;          /* alternate local task */

        /* fields maintained by MMIO functions during buffered I/O */
        LONG            cchBuffer;      /* size of I/O buffer (or 0L) */
        HPSTR           pchBuffer;      /* start of I/O buffer (or NULL) */
        HPSTR           pchNext;        /* pointer to next byte to read/write */
        HPSTR           pchEndRead;     /* pointer to last valid byte to read */
        HPSTR           pchEndWrite;    /* pointer to last byte to write */
        LONG            lBufOffset;     /* disk offset of start of buffer */

        /* fields maintained by I/O procedure */
        LONG            lDiskOffset;    /* disk offset of next read or write */
        DWORD           adwInfo[3];     /* data specific to type of MMIOPROC */

        /* other fields maintained by MMIO */
        DWORD           dwReserved1;    /* reserved for MMIO use */
        DWORD           dwReserved2;    /* reserved for MMIO use */
        HMMIO           hmmio;          /* handle to open file */
} MMIOINFO, *PMMIOINFO, NEAR *NPMMIOINFO, FAR *LPMMIOINFO;
typedef const MMIOINFO FAR *LPCMMIOINFO;


dedndave

  • Member
  • *****
  • Posts: 8734
  • Still using Abacus 2.0
    • DednDave
Re: MMIOINFO Structure Definition
« Reply #2 on: January 16, 2013, 07:24:10 AM »
i see that
i find one other place where it is 4
http://winapi.freetechsecrets.com/mmedia/MMEDIAMMIOINFO.htm

it should be easy enough to verify   :P

dedndave

  • Member
  • *****
  • Posts: 8734
  • Still using Abacus 2.0
    • DednDave
Re: MMIOINFO Structure Definition
« Reply #3 on: January 16, 2013, 07:32:48 AM »
this line is a little confusing, as well - lol
Code: [Select]
wErrorRet   UINT       ?
make up your mind - is it a word or a uint ?   :P

dedndave

  • Member
  • *****
  • Posts: 8734
  • Still using Abacus 2.0
    • DednDave
Re: MMIOINFO Structure Definition
« Reply #4 on: January 16, 2013, 07:48:16 AM »
the current windows.inc file seems to be correct
if mmioOpen had overwritten the last value, i would have crashed into Olly   :P

however, i was expectiing to see the last member being set to the same value as the returned handle
that didn't happen - which is ok - it is used in some other way

MichaelW

  • Global Moderator
  • Member
  • *****
  • Posts: 1209
Re: MMIOINFO Structure Definition
« Reply #5 on: January 16, 2013, 12:28:17 PM »
This for the structure from the 2003 PSDK:
Code: [Select]
#include <windows.h>
int main(void)
{
    MMIOINFO ioi;
    printf("%d\n",sizeof(ioi));
    printf("%d\n\n",sizeof(ioi.adwInfo));
    getch();
    return 0;
}
Code: [Select]
72
12

And for Win16 the wErrorRet member was an unsigned 16-bit integer.
« Last Edit: January 16, 2013, 01:31:55 PM by MichaelW »
Well Microsoft, here’s another nice mess you’ve gotten us into.