#ifdef _MSC_VER
#pragma once
#endif // _MSC_VER
#ifndef _MMISCAPI_H_
#define _MMISCAPI_H_
#include <apiset.h>
#include <apisetcconv.h>
#include <mmsyscom.h> // mm common definitions
#ifdef __cplusplus
extern
"C"
{
#endif
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
#ifndef MMNODRV
#ifdef _WIN32
typedef
struct
{
;
;
;
;
} DRVCONFIGINFOEX, *PDRVCONFIGINFOEX, NEAR *NPDRVCONFIGINFOEX, FAR *LPDRVCONFIGINFOEX;
#else
typedef struct DRVCONFIGINFOEX {
DWORD dwDCISize;
LPCSTR lpszDCISectionName;
LPCSTR lpszDCIAliasName;
DWORD dnDevNode;
} DRVCONFIGINFOEX, *PDRVCONFIGINFOEX, NEAR *NPDRVCONFIGINFOEX, FAR *LPDRVCONFIGINFOEX;
#endif
#if (WINVER < 0x030a) || defined(_WIN32)
#ifndef DRV_LOAD
#define DRV_LOAD 0x0001
#define DRV_ENABLE 0x0002
#define DRV_OPEN 0x0003
#define DRV_CLOSE 0x0004
#define DRV_DISABLE 0x0005
#define DRV_FREE 0x0006
#define DRV_CONFIGURE 0x0007
#define DRV_QUERYCONFIGURE 0x0008
#define DRV_INSTALL 0x0009
#define DRV_REMOVE 0x000A
#define DRV_EXITSESSION 0x000B
#define DRV_POWER 0x000F
#define DRV_RESERVED 0x0800
#define DRV_USER 0x4000
#ifdef _WIN32
typedef
struct
{
;
;
;
} DRVCONFIGINFO, *PDRVCONFIGINFO, NEAR *NPDRVCONFIGINFO, FAR *LPDRVCONFIGINFO;
#else
typedef struct tagDRVCONFIGINFO {
DWORD dwDCISize;
LPCSTR lpszDCISectionName;
LPCSTR lpszDCIAliasName;
} DRVCONFIGINFO, *PDRVCONFIGINFO, NEAR *NPDRVCONFIGINFO, FAR *LPDRVCONFIGINFO;
#endif
#define DRVCNF_CANCEL 0x0000
#define DRVCNF_OK 0x0001
#define DRVCNF_RESTART 0x0002
#ifdef _WIN32
typedef LRESULT (CALLBACK* DRIVERPROC)(DWORD_PTR, HDRVR, UINT, LPARAM, LPARAM);
typedef
(
__stdcall
*
)(
,
,
,
,
);
(
);
(
_In_ LPCWSTR szDriverName,
_In_ LPCWSTR szSectionName,
);
(
);
(
);
(
);
(
_In_ DWORD_PTR dwDriverIdentifier,
);
#else
LRESULT WINAPI DrvClose(HDRVR hdrvr, LPARAM lParam1, LPARAM lParam2);
HDRVR WINAPI DrvOpen(LPCSTR szDriverName, LPCSTR szSectionName, LPARAM lParam2);
LRESULT WINAPI DrvSendMessage(HDRVR hdrvr, UINT uMsg, LPARAM lParam1, LPARAM lParam2);
HINSTANCE WINAPI DrvGetModuleHandle(HDRVR hdrvr);
LRESULT WINAPI DrvDefDriverProc(DWORD dwDriverIdentifier, HDRVR hdrvr, UINT uMsg, LPARAM lParam1, LPARAM lParam2);
#define DefDriverProc DrvDefDriverProc
#endif /* ifdef _WIN32 */
#endif /* DRV_LOAD */
#endif /* ifdef (WINVER < 0x030a) || defined(_WIN32) */
#if (WINVER >= 0x030a)
#define DRV_CANCEL DRVCNF_CANCEL
#define DRV_OK DRVCNF_OK
#define DRV_RESTART DRVCNF_RESTART
#endif /* ifdef WINVER >= 0x030a */
#define DRV_MCI_FIRST DRV_RESERVED
#define DRV_MCI_LAST (DRV_RESERVED + 0xFFF)
(
,
,
,
,
,
,
);
(
_Outptr_ PHANDLE FileHandle
);
typedef DWORD (APIENTRY *DRIVERMSGPROC)(DWORD, DWORD, DWORD_PTR, DWORD_PTR, DWORD_PTR);
typedef
(
__stdcall
*
)(
,
,
,
,
);
(
,
,
,
);
#endif /* ifndef MMNODRV */
#ifndef MMNOMMIO
#define MMIOERR_BASE 256
#define MMIOERR_FILENOTFOUND (MMIOERR_BASE + 1) /* file not found */
#define MMIOERR_OUTOFMEMORY (MMIOERR_BASE + 2) /* out of memory */
#define MMIOERR_CANNOTOPEN (MMIOERR_BASE + 3) /* cannot open */
#define MMIOERR_CANNOTCLOSE (MMIOERR_BASE + 4) /* cannot close */
#define MMIOERR_CANNOTREAD (MMIOERR_BASE + 5) /* cannot read */
#define MMIOERR_CANNOTWRITE (MMIOERR_BASE + 6) /* cannot write */
#define MMIOERR_CANNOTSEEK (MMIOERR_BASE + 7) /* cannot seek */
#define MMIOERR_CANNOTEXPAND (MMIOERR_BASE + 8) /* cannot expand file */
#define MMIOERR_CHUNKNOTFOUND (MMIOERR_BASE + 9) /* chunk not found */
#define MMIOERR_UNBUFFERED (MMIOERR_BASE + 10) /* */
#define MMIOERR_PATHNOTFOUND (MMIOERR_BASE + 11) /* path incorrect */
#define MMIOERR_ACCESSDENIED (MMIOERR_BASE + 12) /* file was protected */
#define MMIOERR_SHARINGVIOLATION (MMIOERR_BASE + 13) /* file in use */
#define MMIOERR_NETWORKERROR (MMIOERR_BASE + 14) /* network not responding */
#define MMIOERR_TOOMANYOPENFILES (MMIOERR_BASE + 15) /* no more file handles */
#define MMIOERR_INVALIDFILE (MMIOERR_BASE + 16) /* default error file error */
#define CFSEPCHAR '+' /* compound file name separator char. */
typedef
;
typedef char _huge * HPSTR; /* a huge version of LPSTR */
DECLARE_HANDLE(HMMIO); /* a handle to an open file */
struct
{
int
;};
typedef
struct
*
;
typedef LRESULT (CALLBACK MMIOPROC)(LPSTR lpmmioinfo, UINT uMsg,
typedef
(
__stdcall
)(
lpmmioinfo,
uMsg,
lParam1,
lParam2);
typedef MMIOPROC FAR *LPMMIOPROC;
typedef
struct
{
;
;
;
;
;
;
;
;
;
;
;
;
[
3
];
;
;
;
} MMIOINFO, *PMMIOINFO, NEAR *NPMMIOINFO, FAR *LPMMIOINFO;
typedef const MMIOINFO FAR *LPCMMIOINFO;
typedef
struct
{
;
;
;
;
;
} MMCKINFO, *PMMCKINFO, NEAR *NPMMCKINFO, FAR *LPMMCKINFO;
typedef
const
*
;
#define MMIO_RWMODE 0x00000003 /* open file for reading/writing/both */
#define MMIO_SHAREMODE 0x00000070 /* file sharing mode number */
#define MMIO_CREATE 0x00001000 /* create new file (or truncate file) */
#define MMIO_PARSE 0x00000100 /* parse new file returning path */
#define MMIO_DELETE 0x00000200 /* create new file (or truncate file) */
#define MMIO_EXIST 0x00004000 /* checks for existence of file */
#define MMIO_ALLOCBUF 0x00010000 /* mmioOpen() should allocate a buffer */
#define MMIO_GETTEMP 0x00020000 /* mmioOpen() should retrieve temp name */
#define MMIO_DIRTY 0x10000000 /* I/O buffer is dirty */
#define MMIO_READ 0x00000000 /* open file for reading only */
#define MMIO_WRITE 0x00000001 /* open file for writing only */
#define MMIO_READWRITE 0x00000002 /* open file for reading and writing */
#define MMIO_COMPAT 0x00000000 /* compatibility mode */
#define MMIO_EXCLUSIVE 0x00000010 /* exclusive-access mode */
#define MMIO_DENYWRITE 0x00000020 /* deny writing to other processes */
#define MMIO_DENYREAD 0x00000030 /* deny reading to other processes */
#define MMIO_DENYNONE 0x00000040 /* deny nothing to other processes */
#define MMIO_FHOPEN 0x0010 /* mmioClose: keep file handle open */
#define MMIO_EMPTYBUF 0x0010 /* mmioFlush: empty the I/O buffer */
#define MMIO_TOUPPER 0x0010 /* mmioStringToFOURCC: to u-case */
#define MMIO_INSTALLPROC 0x00010000 /* mmioInstallIOProc: install MMIOProc */
#define MMIO_GLOBALPROC 0x10000000 /* mmioInstallIOProc: install globally */
#define MMIO_REMOVEPROC 0x00020000 /* mmioInstallIOProc: remove MMIOProc */
#define MMIO_UNICODEPROC 0x01000000 /* mmioInstallIOProc: Unicode MMIOProc */
#define MMIO_FINDPROC 0x00040000 /* mmioInstallIOProc: find an MMIOProc */
#define MMIO_FINDCHUNK 0x0010 /* mmioDescend: find a chunk by ID */
#define MMIO_FINDRIFF 0x0020 /* mmioDescend: find a LIST chunk */
#define MMIO_FINDLIST 0x0040 /* mmioDescend: find a RIFF chunk */
#define MMIO_CREATERIFF 0x0020 /* mmioCreateChunk: make a LIST chunk */
#define MMIO_CREATELIST 0x0040 /* mmioCreateChunk: make a RIFF chunk */
#define MMIOM_READ MMIO_READ /* read */
#define MMIOM_WRITE MMIO_WRITE /* write */
#define MMIOM_SEEK 2 /* seek to a new position in file */
#define MMIOM_OPEN 3 /* open file */
#define MMIOM_CLOSE 4 /* close file */
#define MMIOM_WRITEFLUSH 5 /* write and flush */
#if (WINVER >= 0x030a)
#define MMIOM_RENAME 6 /* rename specified file */
#endif /* ifdef WINVER >= 0x030a */
#define MMIOM_USER 0x8000 /* beginning of user-defined messages */
#define FOURCC_RIFF mmioFOURCC('R', 'I', 'F', 'F')
#define FOURCC_LIST mmioFOURCC('L', 'I', 'S', 'T')
#define FOURCC_DOS mmioFOURCC('D', 'O', 'S', ' ')
#define FOURCC_MEM mmioFOURCC('M', 'E', 'M', ' ')
#ifndef SEEK_SET
#define SEEK_SET 0 /* seek to an absolute position */
#define SEEK_CUR 1 /* seek relative to current position */
#define SEEK_END 2 /* seek relative to end of file */
#endif /* ifndef SEEK_SET */
#define MMIO_DEFAULTBUFFER 8192 /* default buffer size */
#define mmioFOURCC(ch0, ch1, ch2, ch3) MAKEFOURCC(ch0, ch1, ch2, ch3)
#ifdef _WIN32
(
,
);
(
,
);
#ifdef UNICODE
#define mmioStringToFOURCC mmioStringToFOURCCW
#else
#define mmioStringToFOURCC mmioStringToFOURCCA
#endif // !UNICODE
(
_In_opt_ LPMMIOPROC pIOProc,
);
(
_In_opt_ LPMMIOPROC pIOProc,
);
#ifdef UNICODE
#define mmioInstallIOProc mmioInstallIOProcW
#else
#define mmioInstallIOProc mmioInstallIOProcA
#endif // !UNICODE
(
_Inout_updates_bytes_opt_(128) LPSTR pszFileName,
_Inout_opt_ LPMMIOINFO pmmioinfo,
);
(
_Inout_updates_bytes_opt_(128) LPWSTR pszFileName,
_Inout_opt_ LPMMIOINFO pmmioinfo,
);
#ifdef UNICODE
#define mmioOpen mmioOpenW
#else
#define mmioOpen mmioOpenA
#endif // !UNICODE
(
_In_ LPCSTR pszNewFileName,
_In_opt_ LPCMMIOINFO pmmioinfo,
);
(
_In_ LPCWSTR pszFileName,
_In_ LPCWSTR pszNewFileName,
_In_opt_ LPCMMIOINFO pmmioinfo,
);
#ifdef UNICODE
#define mmioRename mmioRenameW
#else
#define mmioRename mmioRenameA
#endif // !UNICODE
#else
FOURCC WINAPI mmioStringToFOURCC( LPCSTR sz, UINT uFlags);
LPMMIOPROC WINAPI mmioInstallIOProc( FOURCC fccIOProc, LPMMIOPROC pIOProc, DWORD dwFlags);
HMMIO WINAPI mmioOpen(_Inout_opt_ LPSTR pszFileName, LPMMIOINFO pmmioinfo, DWORD fdwOpen);
#if (WINVER >= 0x030a)
MMRESULT WINAPI mmioRename( _In_ LPCSTR pszFileName, _In_ LPCSTR pszNewFileName, _In_opt_ const MMIOINFO FAR* pmmioinfo, _In_ DWORD fdwRename);
#endif /* ifdef WINVER >= 0x030a */
#endif
(
);
(
_Out_writes_bytes_(cch) HPSTR pch,
);
(
_In_reads_bytes_(cch) const char _huge * pch,
);
(
);
(
_Out_ LPMMIOINFO pmmioinfo,
);
(
_In_ LPCMMIOINFO pmmioinfo,
);
(
_Out_writes_opt_(cchBuffer) LPSTR pchBuffer,
);
(
);
(
_In_opt_ LPMMIOINFO pmmioinfo,
);
(
);
(
_Inout_ LPMMCKINFO pmmcki,
_In_opt_ const MMCKINFO FAR * pmmckiParent,
);
(
);
(
);
#endif /* ifndef MMNOMMIO */
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
#pragma endregion
#ifdef __cplusplus
}
#endif
#endif // _MMISCAPI_H_