[AVIFIL32] Sync with Wine Staging 3.9. CORE-14656

This commit is contained in:
Amine Khaldi 2018-05-27 04:02:26 +01:00
parent 202ccf50ba
commit 01707e98b5
7 changed files with 108 additions and 23 deletions

View file

@ -156,7 +156,7 @@ static BOOL AVIFILE_GetFileHandlerByExtension(LPCWSTR szFile, LPCLSID lpclsid)
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;
@ -371,7 +371,7 @@ HRESULT WINAPI AVIFileCreateStreamA(PAVIFILE pfile, PAVISTREAM *ppavi,
/* 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);
}
@ -1035,7 +1035,7 @@ HRESULT WINAPI AVIBuildFilterW(LPWSTR szFilter, LONG cbFilter, BOOL fSaving)
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 */
@ -1300,7 +1300,7 @@ static void AVISaveOptionsUpdate(HWND hWnd)
} 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) {
@ -2160,7 +2160,7 @@ HRESULT WINAPI EditStreamSetNameA(PAVISTREAM pstream, LPCSTR szName)
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));
}
@ -2185,7 +2185,7 @@ HRESULT WINAPI EditStreamSetNameW(PAVISTREAM pstream, LPCWSTR szName)
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));
}

View file

@ -21,14 +21,80 @@
#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"),
@ -51,6 +117,13 @@ coclass ICMStream { interface IAVIStream; }
]
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),

View file

@ -2,28 +2,38 @@ HKCR
{
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' }
}
}
}

View file

@ -1641,7 +1641,7 @@ static HRESULT AVIFILE_LoadFile(IAVIFileImpl *This)
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)
@ -1751,9 +1751,9 @@ static HRESULT AVIFILE_LoadFile(IAVIFileImpl *This)
/* 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);
@ -1784,7 +1784,7 @@ static HRESULT AVIFILE_LoadFile(IAVIFileImpl *This)
}
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);
}

View file

@ -22,6 +22,8 @@
#include <windef.h>
#include <winuser.h>
#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
#ifndef MAX_AVISTREAMS
#define MAX_AVISTREAMS 8
#endif

View file

@ -522,9 +522,9 @@ static HRESULT WINAPI IPersistFile_fnLoad(IPersistFile *iface, LPCOLESTR pszFile
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));
}

View file

@ -48,7 +48,7 @@ reactos/dll/win32/advpack # Synced to WineStaging-3.3
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