32#define DEFINE_EXPECT(func) \
33 static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
35#define SET_EXPECT(func) \
36 expect_ ## func = TRUE
38#define CHECK_EXPECT(func) \
40 ok(expect_ ##func, "unexpected call " #func "\n"); \
41 expect_ ## func = FALSE; \
42 called_ ## func = TRUE; \
45#define CHECK_EXPECT2(func) \
47 ok(expect_ ##func, "unexpected call " #func "\n"); \
48 called_ ## func = TRUE; \
51#define CHECK_CALLED(func) \
53 ok(called_ ## func, "expected " #func "\n"); \
54 expect_ ## func = called_ ## func = FALSE; \
57#define CHECK_NOT_CALLED(func) \
59 ok(!called_ ## func, "unexpected " #func "\n"); \
60 expect_ ## func = called_ ## func = FALSE; \
63#define CLEAR_CALLED(func) \
64 expect_ ## func = called_ ## func = FALSE
117 ok(pib !=
NULL,
"pib should not be NULL\n");
119 hres = IBinding_QueryInterface(pib, &IID_IMoniker, (
void**)&mon);
122 IMoniker_Release(mon);
129 ok(0,
"unexpected call\n");
135 ok(0,
"unexpected call\n");
142 switch(ulStatusCode) {
143 case BINDSTATUS_FINDINGRESOURCE:
146 case BINDSTATUS_CONNECTING:
149 case BINDSTATUS_SENDINGREQUEST:
152 case BINDSTATUS_MIMETYPEAVAILABLE:
155 case BINDSTATUS_BEGINDOWNLOADDATA:
157 ok(szStatusText !=
NULL,
"szStatusText == NULL\n");
159 case BINDSTATUS_DOWNLOADINGDATA:
162 case BINDSTATUS_ENDDOWNLOADDATA:
164 ok(szStatusText !=
NULL,
"szStatusText == NULL\n");
166 case BINDSTATUS_CACHEFILENAMEAVAILABLE:
167 ok(szStatusText !=
NULL,
"szStatusText == NULL\n");
170 todo_wine {
ok(0,
"unexpected code %d\n", ulStatusCode); }
182 ok(
SUCCEEDED(hresult),
"Download failed: %08x\n", hresult);
183 ok(szError ==
NULL,
"szError should be NULL\n");
195 *grfBINDF = BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE | BINDF_PULLDATA;
196 cbSize = pbindinfo->cbSize;
197 memset(pbindinfo, 0, cbSize);
198 pbindinfo->cbSize = cbSize;
204 DWORD dwSize, FORMATETC* pformatetc, STGMEDIUM* pstgmed)
215 ok(pformatetc !=
NULL,
"pformatetx == NULL\n");
217 ok(pformatetc->cfFormat == 0xc02d,
"clipformat=%x\n", pformatetc->cfFormat);
218 ok(pformatetc->ptd ==
NULL,
"ptd = %p\n", pformatetc->ptd);
219 ok(pformatetc->dwAspect == 1,
"dwAspect=%u\n", pformatetc->dwAspect);
220 ok(pformatetc->lindex == -1,
"lindex=%d\n", pformatetc->lindex);
221 ok(pformatetc->tymed == TYMED_ISTREAM,
"tymed=%u\n", pformatetc->tymed);
224 ok(pstgmed !=
NULL,
"stgmeg == NULL\n");
226 ok(pstgmed->tymed == TYMED_ISTREAM,
"tymed=%u\n", pstgmed->tymed);
227 ok(
U(*pstgmed).pstm !=
NULL,
"pstm == NULL\n");
228 ok(pstgmed->pUnkForRelease !=
NULL,
"pUnkForRelease == NULL\n");
232 if(
U(*pstgmed).pstm) {
233 do hres = IStream_Read(
U(*pstgmed).pstm,
buf, 512, &readed);
243 ok(0,
"unexpected call\n");
300 ok(
hr ==
E_INVALIDARG,
"URLOpenBlockingStreamW should have failed with E_INVALIDARG instead of 0x%08x\n",
hr);
304 ok(
hr ==
E_INVALIDARG,
"URLOpenBlockingStreamW should have failed with E_INVALIDARG instead of 0x%08x\n",
hr);
317 ok(
hr ==
S_OK,
"URLOpenBlockingStreamW failed with error 0x%08x\n",
hr);
328 ok(pStream !=
NULL,
"pStream is NULL\n");
333 ok(
hr ==
S_OK,
"IStream_Read failed with error 0x%08x\n",
hr);
336 IStream_Release(pStream);
340 ok(
hr ==
S_OK,
"URLOpenBlockingStreamW failed with error 0x%08x\n",
hr);
342 ok(pStream !=
NULL,
"pStream is NULL\n");
347 ok(
hr ==
S_OK,
"IStream_Read failed with error 0x%08x\n",
hr);
350 IStream_Release(pStream);
359 ok(
hr ==
E_INVALIDARG,
"URLOpenStreamW should have failed with E_INVALIDARG instead of 0x%08x\n",
hr);
372 ok(
hr ==
S_OK,
"URLOpenStreamW failed with error 0x%08x\n",
hr);
385 ok(
hr ==
S_OK,
"URLOpenStreamW failed with error 0x%08x\n",
hr);
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
#define GetProcAddress(x, y)
#define INVALID_HANDLE_VALUE
#define CreateFileA(a, b, c, d, e, f, g)
#define FILE_ATTRIBUTE_NORMAL
#define MultiByteToWideChar
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)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
DWORD WINAPI GetCurrentDirectoryA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
GLenum GLuint GLenum GLsizei const GLchar * buf
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
static HRESULT WINAPI statusclb_OnDataAvailable(IBindStatusCallback *iface, DWORD grfBSCF, DWORD dwSize, FORMATETC *pformatetc, STGMEDIUM *pstgmed)
#define CHECK_EXPECT(func)
#define DEFINE_EXPECT(func)
static const IBindStatusCallbackVtbl BindStatusCallbackVtbl
static WCHAR INDEX_HTML[MAX_PATH]
static ULONG WINAPI statusclb_AddRef(IBindStatusCallback *iface)
static ULONG WINAPI statusclb_Release(IBindStatusCallback *iface)
static HRESULT WINAPI statusclb_GetBindInfo(IBindStatusCallback *iface, DWORD *grfBINDF, BINDINFO *pbindinfo)
#define CHECK_EXPECT2(func)
static HRESULT WINAPI statusclb_OnStartBinding(IBindStatusCallback *iface, DWORD dwReserved, IBinding *pib)
static HRESULT WINAPI statusclb_OnStopBinding(IBindStatusCallback *iface, HRESULT hresult, LPCWSTR szError)
static const CHAR wszIndexHtmlA[]
static HRESULT WINAPI statusclb_OnLowResource(IBindStatusCallback *iface, DWORD reserved)
static HRESULT WINAPI statusclb_OnProgress(IBindStatusCallback *iface, ULONG ulProgress, ULONG ulProgressMax, ULONG ulStatusCode, LPCWSTR szStatusText)
#define CHECK_CALLED(func)
static void set_file_url(char *path)
static HRESULT WINAPI statusclb_OnObjectAvailable(IBindStatusCallback *iface, REFIID riid, IUnknown *punk)
static void test_URLOpenStreamW(void)
static HRESULT WINAPI statusclb_GetPriority(IBindStatusCallback *iface, LONG *pnPriority)
static void create_file(void)
static const char szHtmlDoc[]
static HRESULT WINAPI statusclb_QueryInterface(IBindStatusCallback *iface, REFIID riid, void **ppv)
static void test_URLOpenBlockingStreamW(void)
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
#define IsEqualGUID(rguid1, rguid2)
HRESULT WINAPI URLOpenStreamW(LPUNKNOWN pCaller, LPCWSTR szURL, DWORD dwReserved, LPBINDSTATUSCALLBACK lpfnCB)
HRESULT WINAPI URLOpenBlockingStreamW(LPUNKNOWN pCaller, LPCWSTR szURL, LPSTREAM *ppStream, DWORD dwReserved, LPBINDSTATUSCALLBACK lpfnCB)
#define HRESULT_FROM_WIN32(x)
#define ERROR_INTERNET_NAME_NOT_RESOLVED