130 0x00000028, 0x00000008, 0x00000006, 0x00180001,
131 0x30323449, 0x00000090, 0x00000000, 0x00000000,
132 0x00000000, 0x00000000,
137 0x00000004, 0x00000000, 0x63643030
142 0x00000000, 0x00000000,
143 0x0000001e, 0x00000008, 0x00000006, 0x00100009,
144 0x00000008, 0x00000006, 0x00000001, 0x00000006,
145 0x00000008, 0x00000006, 0x00000008, 0x00000000,
146 0x00000000, 0x00000000, 0x00000000,
159 0x00000004, 0x00000000, 0x62773130,
161 0x6c6d646f, 0x686c6d64, 0x000000f8,
165 0x6676614c, 0x332e3235, 0x00302e37,
206 2, streams, poptions);
216 ok(
res == 0,
"0: got refcount %lu (expected 0)\n",
res);
220 ok(
res == 0,
"1: got refcount %lu (expected 0)\n",
res);
254 ok(
hres == 0,
"got 0x%08lX, expected 0\n",
hres);
258#define IS_INFO_UPDATED(m) do { \
259 hres = EditStreamSetInfoA(stream, &info, sizeof(info) ); \
260 ok( hres == 0, "got 0x%08lX, expected 0\n", hres); \
261 hres = AVIStreamInfoA(stream, &info2, sizeof(info2) ); \
262 ok( hres == 0, "got 0x%08lX, expected 0\n", hres); \
263 ok( info2.m == info.m, "EditStreamSetInfo did not update "#m" parameter\n" ); \
300 info.rcFrame.left = 0;
302 info.rcFrame.top = 0;
304 info.rcFrame.right = 0;
306 info.rcFrame.bottom = 0;
309 info.rcFrame.left = -1;
311 info.rcFrame.top = -1;
313 info.rcFrame.right = -1;
315 info.rcFrame.bottom = -1;
318#undef IS_INFO_UPDATED
381 ok(
res == 0,
"Unable to open file: error=%u\n",
res);
383 pStream0 = (
void *)0xdeadbeef;
386 ok(pStream0 ==
NULL,
"AVIFileGetStream should set stream to NULL\n");
389 ok(
res == 0,
"Unable to open video stream: error=%u\n",
res);
392 ok(
res == 0,
"Unable to open audio stream: error=%u\n",
res);
395 ok(
res == 0,
"Unable to read stream info: error=%u\n",
res);
398 ok(
res == 0,
"Unable to read stream info: error=%u\n",
res);
401 ok(
res == 0,
"Unable to read format size: error=%u\n",
res);
404 ok(
res == 0,
"Unable to read format: error=%u\n",
res);
412 ok(asi0.
dwRate == 30000,
"got %lu (expected 30000)\n", asi0.
dwRate);
432 ok(asi1.
dwRate == 11025,
"got %lu (expected 11025)\n", asi1.
dwRate);
454 ok(refcount == 3,
"got %lu (expected 3)\n", refcount);
459 ok(refcount == 2,
"got %lu (expected 2)\n", refcount);
464 ok(refcount == 2,
"got %lu (expected 2)\n", refcount);
470 ok(refcount == 1,
"got %lu (expected 1)\n", refcount);
473 ok(refcount == (
ULONG)-1,
"got %lu (expected 4294967295)\n", refcount);
476 ok(refcount == 1,
"got %lu (expected 1)\n", refcount);
479 ok(refcount == 0,
"got %lu (expected 0)\n", refcount);
500 ok(
res != 0,
"Able to open file: error=%u\n",
res);
524 ok(
res == 0,
"Unable to open file: error=%u\n",
res);
527 ok(
res == 0,
"Unable to open audio stream: error=%u\n",
res);
530 ok(
res == 0,
"Unable to read stream info: error=%u\n",
res);
560 ok(
res == 0,
"Unable to open file: error=%u\n",
res);
563 ok(
res == 0,
"Unable to open audio stream: error=%u\n",
res);
565 ok(
AVIStreamInfoA(pStream1, &asi1,
sizeof(asi1)) == 0,
"Unable to read stream info\n");
596 IUnknown_AddRef(iface);
603 trace(
"Working around COM aggregation ref counting bug\n");
604 ok(
ref ==
This->ref,
"Outer ref count expected %ld got %ld\n",
ref,
This->ref);
606 ref = IUnknown_Release(
This->inner_unk);
607 ok(
ref == 1,
"Inner ref count expected 1 got %ld\n",
ref);
646 ok(
hr ==
S_OK,
"COM aggregation failed: %08lx, expected S_OK\n",
hr);
647 hr = IUnknown_QueryInterface(&unk_obj.
IUnknown_iface, &IID_IAVIFile, (
void**)&avif);
648 ok(
hr ==
S_OK,
"QueryInterface for IID_IAVIFile failed: %08lx\n",
hr);
650 ok(refcount == unk_obj.
ref,
"AVIFile just pretends to support COM aggregation\n");
652 ok(refcount == unk_obj.
ref,
"AVIFile just pretends to support COM aggregation\n");
654 ok(
hr ==
S_OK,
"QueryInterface for IID_IPersistFile failed: %08lx\n",
hr);
655 refcount = IPersistFile_Release(pf);
656 ok(refcount == unk_obj.
ref,
"AVIFile just pretends to support COM aggregation\n");
658 ok(refcount == 19,
"Outer ref count should be back at 19 but is %ld\n", refcount);
659 refcount = IUnknown_Release(unk_obj.
inner_unk);
660 ok(refcount == 0,
"Inner ref count should be 0 but is %lu\n", refcount);
669 ok(
hr ==
S_OK,
"AVIFile create failed: %08lx, expected S_OK\n",
hr);
671 ok(refcount == 2,
"refcount == %lu, expected 2\n", refcount);
673 ok(
hr ==
S_OK,
"QueryInterface for IID_IUnknown failed: %08lx\n",
hr);
674 refcount = IUnknown_AddRef(unk);
675 ok(refcount == 4,
"refcount == %lu, expected 4\n", refcount);
677 ok(
hr ==
S_OK,
"QueryInterface for IID_IPersistFile failed: %08lx\n",
hr);
678 refcount = IPersistFile_AddRef(pf);
679 ok(refcount == 6,
"refcount == %lu, expected 6\n", refcount);
697 ok(
hr ==
S_OK,
"COM aggregation failed: %08lx, expected S_OK\n",
hr);
698 hr = IUnknown_QueryInterface(&unk_obj.
IUnknown_iface, &IID_IAVIFile, (
void**)&avif);
699 ok(
hr ==
S_OK,
"QueryInterface for IID_IAVIFile failed: %08lx\n",
hr);
701 ok(refcount == unk_obj.
ref,
"WAVFile just pretends to support COM aggregation\n");
703 ok(refcount == unk_obj.
ref,
"WAVFile just pretends to support COM aggregation\n");
705 ok(
hr ==
S_OK,
"QueryInterface for IID_IPersistFile failed: %08lx\n",
hr);
706 refcount = IPersistFile_Release(pf);
707 ok(refcount == unk_obj.
ref,
"WAVFile just pretends to support COM aggregation\n");
709 ok(refcount == 19,
"Outer ref count should be back at 19 but is %ld\n", refcount);
710 refcount = IUnknown_Release(unk_obj.
inner_unk);
711 ok(refcount == 0,
"Inner ref count should be 0 but is %lu\n", refcount);
720 ok(
hr ==
S_OK,
"WAVFile create failed: %08lx, expected S_OK\n",
hr);
722 ok(refcount == 2,
"refcount == %lu, expected 2\n", refcount);
725 ok(
hr ==
S_OK,
"QueryInterface for IID_IPersistFile failed: %08lx\n",
hr);
726 refcount = IPersistFile_AddRef(pf);
727 ok(refcount == 4,
"refcount == %lu, expected 4\n", refcount);
728 refcount = IPersistFile_Release(pf);
731 ok(
hr ==
S_OK,
"QueryInterface for IID_IAVIStream failed: %08lx\n",
hr);
733 ok(refcount == 5,
"refcount == %lu, expected 5\n", refcount);
737 ok(
hr ==
S_OK,
"QueryInterface for IID_IUnknown failed: %08lx\n",
hr);
738 refcount = IUnknown_AddRef(unk);
739 ok(refcount == 6,
"refcount == %lu, expected 6\n", refcount);
740 refcount = IUnknown_Release(unk);
747 IAVIEditStream *edit;
755 ok(
hr ==
S_OK,
"AVIEditStream create failed: %08lx, expected S_OK\n",
hr);
757 ok(refcount == 2,
"refcount == %lu, expected 2\n", refcount);
760 ok(
hr ==
S_OK,
"QueryInterface for IID_IAVIEditStream failed: %08lx\n",
hr);
762 ok(refcount == 4,
"refcount == %lu, expected 4\n", refcount);
766 ok(
hr ==
S_OK,
"QueryInterface for IID_IUnknown failed: %08lx\n",
hr);
767 refcount = IUnknown_AddRef(unk);
768 ok(refcount == 5,
"refcount == %lu, expected 5\n", refcount);
769 IUnknown_Release(unk);
#define InterlockedIncrement
#define InterlockedDecrement
HRESULT WINAPI EditStreamSetInfoA(PAVISTREAM pstream, LPAVISTREAMINFOA asi, LONG size)
BOOL WINAPI AVISaveOptions(HWND hWnd, UINT uFlags, INT nStreams, PAVISTREAM *ppavi, LPAVICOMPRESSOPTIONS *ppOptions)
HRESULT WINAPI EditStreamSetNameA(PAVISTREAM pstream, LPCSTR szName)
HRESULT WINAPI AVISaveOptionsFree(INT nStreams, LPAVICOMPRESSOPTIONS *ppOptions)
HRESULT WINAPI AVIFileGetStream(PAVIFILE pfile, PAVISTREAM *avis, DWORD fccType, LONG lParam)
void WINAPI AVIFileExit(void)
ULONG WINAPI AVIStreamAddRef(PAVISTREAM pstream)
HRESULT WINAPI AVIFileOpenA(PAVIFILE *ppfile, LPCSTR szFile, UINT uMode, LPCLSID lpHandler)
void WINAPI AVIFileInit(void)
HRESULT WINAPI AVIStreamInfoA(PAVISTREAM pstream, LPAVISTREAMINFOA asi, LONG size)
LONG WINAPI AVIStreamStart(PAVISTREAM pstream)
ULONG WINAPI AVIFileRelease(PAVIFILE pfile)
ULONG WINAPI AVIFileAddRef(PAVIFILE pfile)
HRESULT WINAPI AVIStreamReadFormat(PAVISTREAM pstream, LONG pos, LPVOID format, LPLONG formatsize)
ULONG WINAPI AVIStreamRelease(PAVISTREAM pstream)
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, IUnknown *outer, DWORD cls_context, REFIID riid, void **obj)
#define INVALID_HANDLE_VALUE
#define CreateFileA(a, b, c, d, e, f, g)
#define FILE_ATTRIBUTE_NORMAL
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
BOOL WINAPI WriteFile(_In_ HANDLE hFile, _In_reads_bytes_opt_(nNumberOfBytesToWrite) LPCVOID lpBuffer, _In_ DWORD nNumberOfBytesToWrite, _Out_opt_ LPDWORD lpNumberOfBytesWritten, _Inout_opt_ LPOVERLAPPED lpOverlapped)
DWORD WINAPI GetTempPathA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
_ACRTIMP size_t __cdecl strlen(const char *)
HRESULT WINAPI CreateEditableStream(IAVIStream **editable, IAVIStream *src)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
#define memcpy(s1, s2, n)
struct pcmwaveformat_tag PCMWAVEFORMAT
#define mmioFOURCC(c0, c1, c2, c3)
struct common_avi_headers COMMON_AVI_HEADERS
static const AVIStreamHeader defash0
static const CHAR winetest0[]
static const AVIStreamHeader defash1
static void test_amh_corruption(void)
static void test_ash1_corruption2(void)
static void test_ash1_corruption(void)
static const PCMWAVEFORMAT defpcmwf
static void test_COM_editstream(void)
static const DWORD audiostreamformat_pre[]
static const DWORD padding1[]
static void init_test_struct(COMMON_AVI_HEADERS *cah)
static void test_COM_wavfile(void)
static const CHAR testfilename[]
static void test_AVISaveOptions(void)
static ULONG WINAPI unk_Release(IUnknown *iface)
static const MainAVIHeader defmah
static ULONG get_file_refcount(PAVIFILE file)
static struct unk_impl * impl_from_IUnknown(IUnknown *iface)
static HRESULT WINAPI unk_QueryInterface(IUnknown *iface, REFIID riid, void **ppv)
static const DWORD videostreamformat[]
static void create_avi_file(const COMMON_AVI_HEADERS *cah, char *filename)
static const CHAR winetest1[]
static const DWORD streamlist[]
static ULONG WINAPI unk_AddRef(IUnknown *iface)
static const DWORD deffh[]
static void test_EditStreamSetInfo(void)
static const IUnknownVtbl unk_vtbl
#define IS_INFO_UPDATED(m)
static void test_default_data(void)
static const DWORD videopropheader[]
static void test_COM(void)
const GUID IID_IPersistFile
#define IsEqualGUID(rguid1, rguid2)
DWORD dwFormatChangeCount
DWORD dwSuggestedBufferSize
#define CONTAINING_RECORD(address, type, field)
struct _MainAVIHeader MainAVIHeader
#define IAVIEditStream_AddRef(p)
#define IAVIStream_AddRef(p)
#define listtypeSTREAMHEADER
#define IAVIStream_QueryInterface(p, a, b)
#define ICMF_CHOOSE_KEYFRAME
#define DEFINE_AVIGUID(name, l, w1, w2)
#define listtypeAVIHEADER
#define IAVIEditStream_QueryInterface(p, a, b)
#define IAVIFile_QueryInterface(p, a, b)
#define ICMF_CHOOSE_DATARATE
#define IAVIFile_Release(p)
#define IAVIFile_AddRef(p)
#define IAVIStream_Release(p)
#define ICMF_CHOOSE_ALLCOMPRESSORS
#define IAVIEditStream_Release(p)
DWORD WINAPI GetLastError(void)
#define OF_SHARE_DENY_WRITE