CHAR szRegKey[25];
CHAR szValue[100];
LPWSTR szExt = strrchrW(szFile, '.');
- LONG len = sizeof(szValue) / sizeof(szValue[0]);
+ LONG len = ARRAY_SIZE(szValue);
if (szExt == NULL)
return FALSE;
/* Only the szName at the end is different */
memcpy(&psiw, psi, sizeof(*psi) - sizeof(psi->szName));
MultiByteToWideChar(CP_ACP, 0, psi->szName, -1, psiw.szName,
- sizeof(psiw.szName) / sizeof(psiw.szName[0]));
+ ARRAY_SIZE(psiw.szName));
return IAVIFile_CreateStream(pfile, ppavi, &psiw);
}
HeapFree(GetProcessHeap(), 0, lp);
return AVIERR_ERROR;
}
- for (n = 0;RegEnumKeyW(hKey, n, szFileExt, sizeof(szFileExt)/sizeof(szFileExt[0])) == ERROR_SUCCESS;n++) {
+ for (n = 0;RegEnumKeyW(hKey, n, szFileExt, ARRAY_SIZE(szFileExt)) == ERROR_SUCCESS;n++) {
WCHAR clsidW[40];
/* get CLSID to extension */
} else {
LoadStringW(AVIFILE_hModule, IDS_UNCOMPRESSED,
icinfo.szDescription,
- sizeof(icinfo.szDescription)/sizeof(icinfo.szDescription[0]));
+ ARRAY_SIZE(icinfo.szDescription));
lstrcatW(szFormat, icinfo.szDescription);
}
} else if (sInfo.fccType == streamtypeAUDIO) {
return hres;
memset(asia.szName, 0, sizeof(asia.szName));
- lstrcpynA(asia.szName, szName, sizeof(asia.szName)/sizeof(asia.szName[0]));
+ lstrcpynA(asia.szName, szName, ARRAY_SIZE(asia.szName));
return EditStreamSetInfoA(pstream, &asia, sizeof(asia));
}
return hres;
memset(asiw.szName, 0, sizeof(asiw.szName));
- lstrcpynW(asiw.szName, szName, sizeof(asiw.szName)/sizeof(asiw.szName[0]));
+ lstrcpynW(asiw.szName, szName, ARRAY_SIZE(asiw.szName));
return EditStreamSetInfoW(pstream, &asiw, sizeof(asiw));
}
#pragma makedep proxy
#pragma makedep register
-#include "avifile_ifaces.idl"
+import "wtypes.idl";
+import "unknwn.idl";
+
+typedef struct _AVISTREAMINFOW
+{
+ DWORD fccType;
+ DWORD fccHandler;
+ DWORD dwFlags;
+ DWORD dwCaps;
+ WORD wPriority;
+ WORD wLanguage;
+ DWORD dwScale;
+ DWORD dwRate;
+ DWORD dwStart;
+ DWORD dwLength;
+ DWORD dwInitialFrames;
+ DWORD dwSuggestedBufferSize;
+ DWORD dwQuality;
+ DWORD dwSampleSize;
+ RECT rcFrame;
+ DWORD dwEditCount;
+ DWORD dwFormatChangeCount;
+ WCHAR szName[64];
+} AVISTREAMINFOW;
[
- helpstring("IAVIStream & IAVIFile Proxy"),
- threading(both),
- uuid(0002000d-0000-0000-c000-000000000046)
+ object,
+ uuid(00020021-0000-0000-c000-000000000046)
]
-coclass PSFactoryBuffer { interface IFactoryBuffer; }
+interface IAVIStream : IUnknown
+{
+ HRESULT Create(LPARAM lParam1, LPARAM lParam2);
+ HRESULT Info(AVISTREAMINFOW *psi, LONG lSize);
+ LONG FindSample(LONG lPos, LONG lFlags);
+ HRESULT ReadFormat(LONG lPos, [out,size_is(*lpcbFormat)] char *lpFormat, [in,out] LONG *lpcbFormat);
+ HRESULT SetFormat(LONG lPos, [in,size_is(cbFormat)] char *lpFormat, LONG cbFormat);
+ HRESULT Read(LONG lStart, LONG lSamples, [out,size_is(cbBuffer)] char *lpBuffer, LONG cbBuffer, LONG *plBytes, LONG *plSamples);
+ HRESULT Write(LONG lStart, LONG lSamples, [in,size_is(cbBuffer)] char *lpBuffer, LONG cbBuffer, DWORD dwFlags, LONG *plSampWritten, LONG *plBytesWritten);
+ HRESULT Delete(LONG lStart, LONG lSamples);
+ HRESULT ReadData(DWORD fcc, [out,size_is(*lpcbBuffer)] char *lpBuffer, [in,out] LONG *lpcbBuffer);
+ HRESULT WriteData(DWORD fcc, [in,size_is(cbBuffer)] char *lpBuffer, LONG cbBuffer);
+ HRESULT SetInfo(AVISTREAMINFOW *plInfo, LONG cbInfo);
+};
+
+typedef struct _AVIFILEINFOW
+{
+ DWORD dwMaxBytesPerSec;
+ DWORD dwFlags;
+ DWORD dwCaps;
+ DWORD dwStreams;
+ DWORD dwSuggestedBufferSize;
+ DWORD dwWidth;
+ DWORD dwHeight;
+ DWORD dwScale;
+ DWORD dwRate;
+ DWORD dwLength;
+ DWORD dwEditCount;
+ WCHAR szFileType[64];
+} AVIFILEINFOW;
+
+[
+ object,
+ uuid(00020020-0000-0000-c000-000000000046)
+]
+interface IAVIFile : IUnknown
+{
+ HRESULT Info(AVIFILEINFOW *pfi, LONG lSize);
+ HRESULT GetStream(IAVIStream **ppStream, DWORD fccType, LONG lParam);
+ HRESULT CreateStream(IAVIStream **ppStream, AVISTREAMINFOW *psi);
+ HRESULT WriteData(DWORD fcc, [in,size_is(cbBuffer)] char *lpBuffer, LONG cbBuffer);
+ HRESULT ReadData(DWORD fcc, [out,size_is(*lpcbBuffer)] char *lpBuffer, [in,out] LONG *lpcbBuffer);
+ HRESULT EndRecord(void);
+ HRESULT DeleteStream(DWORD fccType, LONG lParam);
+};
[
helpstring("Microsoft AVI Files"),
]
coclass WAVFile { interface IAVIFile; }
+[
+ helpstring("IAVIStream & IAVIFile Proxy"),
+ threading(both),
+ uuid(0002000d-0000-0000-c000-000000000046)
+]
+coclass PSFactoryBuffer { interface IFactoryBuffer; }
+
[
helpstring("ACM Compressed Audio Stream"),
threading(both),
{
NoRemove Interface
{
+ '{00020021-0000-0000-C000-000000000046}' = s 'IAVIStream'
+ {
+ NumMethods = s 14
+ ProxyStubClsid32 = s '{0002000D-0000-0000-C000-000000000046}'
+ }
+ '{00020020-0000-0000-C000-000000000046}' = s 'IAVIFile'
+ {
+ NumMethods = s 10
+ ProxyStubClsid32 = s '{0002000D-0000-0000-C000-000000000046}'
+ }
}
NoRemove CLSID
{
'{00020000-0000-0000-C000-000000000046}' = s 'Microsoft AVI Files'
{
- InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Apartment' }
+ InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Both' }
}
'{00020001-0000-0000-C000-000000000046}' = s 'AVI Compressed Stream'
{
- InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Apartment' }
+ InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Both' }
}
'{00020003-0000-0000-C000-000000000046}' = s 'Microsoft Wave File'
{
- InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Apartment' }
+ InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Both' }
}
'{0002000D-0000-0000-C000-000000000046}' = s 'IAVIStream & IAVIFile Proxy'
{
- InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Apartment' }
+ InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Both' }
}
'{0002000F-0000-0000-C000-000000000046}' = s 'ACM Compressed Audio Stream'
{
- InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Apartment' }
+ InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Both' }
}
}
}
This->fInfo.dwWidth = MainAVIHdr.dwWidth;
This->fInfo.dwHeight = MainAVIHdr.dwHeight;
LoadStringW(AVIFILE_hModule, IDS_AVIFILETYPE, This->fInfo.szFileType,
- sizeof(This->fInfo.szFileType)/sizeof(This->fInfo.szFileType[0]));
+ ARRAY_SIZE(This->fInfo.szFileType));
/* go back to into header list */
if (mmioAscend(This->hmmio, &ck, 0) != S_OK)
/* generate description for stream like "filename.avi Type #n" */
if (streamHdr.fccType == streamtypeVIDEO)
- LoadStringW(AVIFILE_hModule, IDS_VIDEO, szType, sizeof(szType)/sizeof(szType[0]));
+ LoadStringW(AVIFILE_hModule, IDS_VIDEO, szType, ARRAY_SIZE(szType));
else if (streamHdr.fccType == streamtypeAUDIO)
- LoadStringW(AVIFILE_hModule, IDS_AUDIO, szType, sizeof(szType)/sizeof(szType[0]));
+ LoadStringW(AVIFILE_hModule, IDS_AUDIO, szType, ARRAY_SIZE(szType));
else
wsprintfW(szType, streamTypeFmt, (char*)&streamHdr.fccType);
}
MultiByteToWideChar(CP_ACP, 0, str, -1, pStream->sInfo.szName,
- sizeof(pStream->sInfo.szName)/sizeof(pStream->sInfo.szName[0]));
+ ARRAY_SIZE(pStream->sInfo.szName));
HeapFree(GetProcessHeap(), 0, str);
}
#include <windef.h>
#include <winuser.h>
+#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
+
#ifndef MAX_AVISTREAMS
#define MAX_AVISTREAMS 8
#endif
memset(& This->sInfo, 0, sizeof(This->sInfo));
LoadStringW(AVIFILE_hModule, IDS_WAVEFILETYPE, This->fInfo.szFileType,
- sizeof(This->fInfo.szFileType)/sizeof(This->fInfo.szFileType[0]));
+ ARRAY_SIZE(This->fInfo.szFileType));
if (LoadStringW(AVIFILE_hModule, IDS_WAVESTREAMFORMAT,
- wszStreamFmt, sizeof(wszStreamFmt)/sizeof(wszStreamFmt[0])) > 0) {
+ wszStreamFmt, ARRAY_SIZE(wszStreamFmt)) > 0) {
wsprintfW(This->sInfo.szName, wszStreamFmt,
AVIFILE_BasenameW(This->szFileName));
}
reactos/dll/win32/atl # Synced to WineStaging-3.3
reactos/dll/win32/atl80 # Synced to WineStaging-3.3
reactos/dll/win32/atl100 # Synced to WineStaging-3.3
-reactos/dll/win32/avifil32 # Synced to WineStaging-3.3
+reactos/dll/win32/avifil32 # Synced to WineStaging-3.9
reactos/dll/win32/bcrypt # Synced to WineStaging-1.9.23
reactos/dll/win32/browseui # Out of sync
reactos/dll/win32/cabinet # Synced to WineStaging-3.3