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 %u (expected 0)\n",
res);
220 ok(
res == 0,
"1: got refcount %u (expected 0)\n",
res);
254 ok(
hres == 0,
"got 0x%08X, expected 0\n",
hres);
258#define IS_INFO_UPDATED(m) do { \
259 hres = EditStreamSetInfoA(stream, &info, sizeof(info) ); \
260 ok( hres == 0, "got 0x%08X, expected 0\n", hres); \
261 hres = AVIStreamInfoA(stream, &info2, sizeof(info2) ); \
262 ok( hres == 0, "got 0x%08X, 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
374 ok(
res == 0,
"Unable to open file: error=%u\n",
res);
376 pStream0 = (
void *)0xdeadbeef;
379 ok(pStream0 ==
NULL,
"AVIFileGetStream should set stream to NULL\n");
382 ok(
res == 0,
"Unable to open video stream: error=%u\n",
res);
385 ok(
res == 0,
"Unable to open audio stream: error=%u\n",
res);
388 ok(
res == 0,
"Unable to read stream info: error=%u\n",
res);
391 ok(
res == 0,
"Unable to read stream info: error=%u\n",
res);
394 ok(
res == 0,
"Unable to read format size: error=%u\n",
res);
397 ok(
res == 0,
"Unable to read format: error=%u\n",
res);
405 ok(asi0.
dwRate == 30000,
"got %u (expected 30000)\n", asi0.
dwRate);
425 ok(asi1.
dwRate == 11025,
"got %u (expected 11025)\n", asi1.
dwRate);
468 ok(
res != 0,
"Able to open file: error=%u\n",
res);
492 ok(
res == 0,
"Unable to open file: error=%u\n",
res);
495 ok(
res == 0,
"Unable to open audio stream: error=%u\n",
res);
498 ok(
res == 0,
"Unable to read stream info: error=%u\n",
res);
528 ok(
res == 0,
"Unable to open file: error=%u\n",
res);
531 ok(
res == 0,
"Unable to open audio stream: error=%u\n",
res);
533 ok(
AVIStreamInfoA(pStream1, &asi1,
sizeof(asi1)) == 0,
"Unable to read stream info\n");
564 IUnknown_AddRef(iface);
571 trace(
"Working around COM aggregation ref counting bug\n");
572 ok(
ref ==
This->ref,
"Outer ref count expected %d got %d\n",
ref,
This->ref);
574 ref = IUnknown_Release(
This->inner_unk);
575 ok(
ref == 1,
"Inner ref count expected 1 got %d\n",
ref);
614 ok(
hr ==
S_OK,
"COM aggregation failed: %08x, expected S_OK\n",
hr);
615 hr = IUnknown_QueryInterface(&unk_obj.
IUnknown_iface, &IID_IAVIFile, (
void**)&avif);
616 ok(
hr ==
S_OK,
"QueryInterface for IID_IAVIFile failed: %08x\n",
hr);
618 ok(refcount == unk_obj.
ref,
"AVIFile just pretends to support COM aggregation\n");
620 ok(refcount == unk_obj.
ref,
"AVIFile just pretends to support COM aggregation\n");
622 ok(
hr ==
S_OK,
"QueryInterface for IID_IPersistFile failed: %08x\n",
hr);
623 refcount = IPersistFile_Release(pf);
624 ok(refcount == unk_obj.
ref,
"AVIFile just pretends to support COM aggregation\n");
626 ok(refcount == 19,
"Outer ref count should be back at 19 but is %d\n", refcount);
627 refcount = IUnknown_Release(unk_obj.
inner_unk);
628 ok(refcount == 0,
"Inner ref count should be 0 but is %u\n", refcount);
637 ok(
hr ==
S_OK,
"AVIFile create failed: %08x, expected S_OK\n",
hr);
639 ok(refcount == 2,
"refcount == %u, expected 2\n", refcount);
641 ok(
hr ==
S_OK,
"QueryInterface for IID_IUnknown failed: %08x\n",
hr);
642 refcount = IUnknown_AddRef(unk);
643 ok(refcount == 4,
"refcount == %u, expected 4\n", refcount);
645 ok(
hr ==
S_OK,
"QueryInterface for IID_IPersistFile failed: %08x\n",
hr);
646 refcount = IPersistFile_AddRef(pf);
647 ok(refcount == 6,
"refcount == %u, expected 6\n", refcount);
665 ok(
hr ==
S_OK,
"COM aggregation failed: %08x, expected S_OK\n",
hr);
666 hr = IUnknown_QueryInterface(&unk_obj.
IUnknown_iface, &IID_IAVIFile, (
void**)&avif);
667 ok(
hr ==
S_OK,
"QueryInterface for IID_IAVIFile failed: %08x\n",
hr);
669 ok(refcount == unk_obj.
ref,
"WAVFile just pretends to support COM aggregation\n");
671 ok(refcount == unk_obj.
ref,
"WAVFile just pretends to support COM aggregation\n");
673 ok(
hr ==
S_OK,
"QueryInterface for IID_IPersistFile failed: %08x\n",
hr);
674 refcount = IPersistFile_Release(pf);
675 ok(refcount == unk_obj.
ref,
"WAVFile just pretends to support COM aggregation\n");
677 ok(refcount == 19,
"Outer ref count should be back at 19 but is %d\n", refcount);
678 refcount = IUnknown_Release(unk_obj.
inner_unk);
679 ok(refcount == 0,
"Inner ref count should be 0 but is %u\n", refcount);
688 ok(
hr ==
S_OK,
"WAVFile create failed: %08x, expected S_OK\n",
hr);
690 ok(refcount == 2,
"refcount == %u, expected 2\n", refcount);
693 ok(
hr ==
S_OK,
"QueryInterface for IID_IPersistFile failed: %08x\n",
hr);
694 refcount = IPersistFile_AddRef(pf);
695 ok(refcount == 4,
"refcount == %u, expected 4\n", refcount);
696 refcount = IPersistFile_Release(pf);
699 ok(
hr ==
S_OK,
"QueryInterface for IID_IAVIStream failed: %08x\n",
hr);
701 ok(refcount == 5,
"refcount == %u, expected 5\n", refcount);
705 ok(
hr ==
S_OK,
"QueryInterface for IID_IUnknown failed: %08x\n",
hr);
706 refcount = IUnknown_AddRef(unk);
707 ok(refcount == 6,
"refcount == %u, expected 6\n", refcount);
708 refcount = IUnknown_Release(unk);
715 IAVIEditStream *edit;
723 ok(
hr ==
S_OK,
"AVIEditStream create failed: %08x, expected S_OK\n",
hr);
725 ok(refcount == 2,
"refcount == %u, expected 2\n", refcount);
728 ok(
hr ==
S_OK,
"QueryInterface for IID_IAVIEditStream failed: %08x\n",
hr);
730 ok(refcount == 4,
"refcount == %u, expected 4\n", refcount);
734 ok(
hr ==
S_OK,
"QueryInterface for IID_IUnknown failed: %08x\n",
hr);
735 refcount = IUnknown_AddRef(unk);
736 ok(refcount == 5,
"refcount == %u, expected 5\n", refcount);
737 IUnknown_Release(unk);
ACPI_SIZE strlen(const char *String)
char * strcpy(char *DstString, const char *SrcString)
#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)
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)
HRESULT WINAPI AVIStreamReadFormat(PAVISTREAM pstream, LONG pos, LPVOID format, LPLONG formatsize)
ULONG WINAPI AVIStreamRelease(PAVISTREAM pstream)
#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 LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
DWORD WINAPI GetTempPathA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
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 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