Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
51077d1e
Commit
51077d1e
authored
Dec 20, 2004
by
Jacek Caban
Committed by
Alexandre Julliard
Dec 20, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Added test of BindToStorage.
- Added some declarations to urlmon.idl.
parent
6c1494b1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
248 additions
and
108 deletions
+248
-108
Makefile.in
dlls/urlmon/tests/Makefile.in
+2
-1
url.c
dlls/urlmon/tests/url.c
+122
-10
umon.c
dlls/urlmon/umon.c
+98
-97
urlmon.idl
include/urlmon.idl
+26
-0
No files found.
dlls/urlmon/tests/Makefile.in
View file @
51077d1e
...
@@ -3,7 +3,8 @@ TOPOBJDIR = ../../..
...
@@ -3,7 +3,8 @@ TOPOBJDIR = ../../..
SRCDIR
=
@srcdir@
SRCDIR
=
@srcdir@
VPATH
=
@srcdir@
VPATH
=
@srcdir@
TESTDLL
=
urlmon.dll
TESTDLL
=
urlmon.dll
IMPORTS
=
urlmon
IMPORTS
=
urlmon user32
EXTRALIBS
=
-luuid
CTESTS
=
\
CTESTS
=
\
generated.c
\
generated.c
\
...
...
dlls/urlmon/tests/url.c
View file @
51077d1e
...
@@ -29,9 +29,19 @@
...
@@ -29,9 +29,19 @@
#include "wine/test.h"
#include "wine/test.h"
#ifdef NONAMELESSUNION
# define U(x) (x).u
#else
# define U(x) (x)
#endif
static
const
WCHAR
TEST_URL_1
[]
=
{
'h'
,
't'
,
't'
,
'p'
,
':'
,
'/'
,
'/'
,
'w'
,
'w'
,
'w'
,
'.'
,
'w'
,
'i'
,
'n'
,
'e'
,
'h'
,
'q'
,
'.'
,
'o'
,
'r'
,
'g'
,
'/'
,
'\0'
};
static
const
WCHAR
TEST_URL_1
[]
=
{
'h'
,
't'
,
't'
,
'p'
,
':'
,
'/'
,
'/'
,
'w'
,
'w'
,
'w'
,
'.'
,
'w'
,
'i'
,
'n'
,
'e'
,
'h'
,
'q'
,
'.'
,
'o'
,
'r'
,
'g'
,
'/'
,
'\0'
};
static
const
WCHAR
TEST_PART_URL_1
[]
=
{
'/'
,
't'
,
'e'
,
's'
,
't'
,
'/'
,
'\0'
};
static
const
WCHAR
TEST_PART_URL_1
[]
=
{
'/'
,
't'
,
'e'
,
's'
,
't'
,
'/'
,
'\0'
};
static
const
WCHAR
WINE_ABOUT_URL
[]
=
{
'h'
,
't'
,
't'
,
'p'
,
':'
,
'/'
,
'/'
,
'w'
,
'w'
,
'w'
,
'.'
,
'w'
,
'i'
,
'n'
,
'e'
,
'h'
,
'q'
,
'.'
,
'o'
,
'r'
,
'g'
,
'/'
,
's'
,
'i'
,
't'
,
'e'
,
'/'
,
'a'
,
'b'
,
'o'
,
'u'
,
't'
,
0
};
static
BOOL
stopped_binding
=
FALSE
;
static
void
test_CreateURLMoniker
(
LPCWSTR
url1
,
LPCWSTR
url2
)
static
void
test_CreateURLMoniker
(
LPCWSTR
url1
,
LPCWSTR
url2
)
{
{
HRESULT
hr
;
HRESULT
hr
;
...
@@ -56,6 +66,8 @@ static void test_create()
...
@@ -56,6 +66,8 @@ static void test_create()
typedef
struct
{
typedef
struct
{
IBindStatusCallbackVtbl
*
lpVtbl
;
IBindStatusCallbackVtbl
*
lpVtbl
;
ULONG
ref
;
ULONG
ref
;
IBinding
*
pbind
;
IStream
*
pstr
;
}
statusclb
;
}
statusclb
;
static
HRESULT
WINAPI
statusclb_QueryInterface
(
IBindStatusCallback
*
iface
,
REFIID
riid
,
void
**
ppvObject
)
static
HRESULT
WINAPI
statusclb_QueryInterface
(
IBindStatusCallback
*
iface
,
REFIID
riid
,
void
**
ppvObject
)
...
@@ -78,12 +90,19 @@ static ULONG WINAPI statusclb_Release(IBindStatusCallback *iface)
...
@@ -78,12 +90,19 @@ static ULONG WINAPI statusclb_Release(IBindStatusCallback *iface)
return
ref
;
return
ref
;
}
}
static
HRESULT
WINAPI
statusclb_OnStartBinding
(
IBindStatusCallback
*
iface
,
DWORD
dwReserved
,
IBinding
*
pib
)
static
HRESULT
WINAPI
statusclb_OnStartBinding
(
IBindStatusCallback
*
iface
,
DWORD
dwReserved
,
IBinding
*
pib
)
{
{
return
E_NOTIMPL
;
statusclb
*
This
=
(
statusclb
*
)
iface
;
This
->
pbind
=
pib
;
ok
(
pib
!=
NULL
,
"pib should not be NULL
\n
"
);
if
(
pib
)
IBinding_AddRef
(
pib
);
return
S_OK
;
}
}
static
HRESULT
WINAPI
statusclb_GetPriority
(
IBindStatusCallback
*
iface
,
LONG
*
pnPriority
)
static
HRESULT
WINAPI
statusclb_GetPriority
(
IBindStatusCallback
*
iface
,
LONG
*
pnPriority
)
{
{
return
E_NOTIMPL
;
return
E_NOTIMPL
;
}
}
...
@@ -96,26 +115,58 @@ static HRESULT WINAPI statusclb_OnLowResource(IBindStatusCallback *iface, DWORD
...
@@ -96,26 +115,58 @@ static HRESULT WINAPI statusclb_OnLowResource(IBindStatusCallback *iface, DWORD
static
HRESULT
WINAPI
statusclb_OnProgress
(
IBindStatusCallback
*
iface
,
ULONG
ulProgress
,
ULONG
ulProgressMax
,
static
HRESULT
WINAPI
statusclb_OnProgress
(
IBindStatusCallback
*
iface
,
ULONG
ulProgress
,
ULONG
ulProgressMax
,
ULONG
ulStatusCode
,
LPCWSTR
szStatusText
)
ULONG
ulStatusCode
,
LPCWSTR
szStatusText
)
{
{
return
E_NOTIMPL
;
return
S_OK
;
}
}
static
HRESULT
WINAPI
statusclb_OnStopBinding
(
IBindStatusCallback
*
iface
,
HRESULT
hresult
,
LPCWSTR
szError
)
static
HRESULT
WINAPI
statusclb_OnStopBinding
(
IBindStatusCallback
*
iface
,
HRESULT
hresult
,
LPCWSTR
szError
)
{
{
return
E_NOTIMPL
;
statusclb
*
This
=
(
statusclb
*
)
iface
;
ok
(
SUCCEEDED
(
hresult
),
"Download failed: %08lx
\n
"
,
hresult
);
ok
(
szError
==
NULL
,
"szError should be NULL
\n
"
);
stopped_binding
=
TRUE
;
IBinding_Release
(
This
->
pbind
);
ok
(
This
->
pstr
!=
NULL
,
"pstr should not be NULL here
\n
"
);
if
(
This
->
pstr
)
IStream_Release
(
This
->
pstr
);
return
S_OK
;
}
}
static
HRESULT
WINAPI
statusclb_GetBindInfo
(
IBindStatusCallback
*
iface
,
DWORD
*
grfBINDF
,
BINDINFO
*
pbindinfo
)
static
HRESULT
WINAPI
statusclb_GetBindInfo
(
IBindStatusCallback
*
iface
,
DWORD
*
grfBINDF
,
BINDINFO
*
pbindinfo
)
{
{
return
E_NOTIMPL
;
DWORD
cbSize
;
*
grfBINDF
=
BINDF_ASYNCHRONOUS
|
BINDF_ASYNCSTORAGE
|
BINDF_PULLDATA
;
cbSize
=
pbindinfo
->
cbSize
;
memset
(
pbindinfo
,
0
,
cbSize
);
pbindinfo
->
cbSize
=
cbSize
;
return
S_OK
;
}
}
static
HRESULT
WINAPI
statusclb_OnDataAvailable
(
IBindStatusCallback
*
iface
,
DWORD
grfBSCF
,
DWORD
dwSize
,
static
HRESULT
WINAPI
statusclb_OnDataAvailable
(
IBindStatusCallback
*
iface
,
DWORD
grfBSCF
,
DWORD
dwSize
,
FORMATETC
*
pformatetc
,
STGMEDIUM
*
pstgmed
)
FORMATETC
*
pformatetc
,
STGMEDIUM
*
pstgmed
)
{
{
return
E_NOTIMPL
;
statusclb
*
This
=
(
statusclb
*
)
iface
;
HRESULT
hres
;
DWORD
readed
;
BYTE
buf
[
512
];
if
(
!
This
->
pstr
)
{
ok
(
grfBSCF
&
BSCF_FIRSTDATANOTIFICATION
,
"pstr should be set when BSCF_FIRSTDATANOTIFICATION
\n
"
);
This
->
pstr
=
U
(
*
pstgmed
).
pstm
;
IStream_AddRef
(
This
->
pstr
);
ok
(
This
->
pstr
!=
NULL
,
"pstr should not be NULL here
\n
"
);
}
do
hres
=
IStream_Read
(
This
->
pstr
,
buf
,
512
,
&
readed
);
while
(
hres
==
S_OK
);
ok
(
hres
==
S_FALSE
||
hres
==
E_PENDING
,
"IStream_Read returned %08lx
\n
"
,
hres
);
return
S_OK
;
}
}
static
HRESULT
WINAPI
statusclb_OnObjectAvailable
(
IBindStatusCallback
*
iface
,
REFIID
riid
,
IUnknown
*
punk
)
static
HRESULT
WINAPI
statusclb_OnObjectAvailable
(
IBindStatusCallback
*
iface
,
REFIID
riid
,
IUnknown
*
punk
)
{
{
return
E_NOTIMPL
;
return
E_NOTIMPL
;
}
}
...
@@ -139,6 +190,8 @@ static IBindStatusCallback* statusclb_create()
...
@@ -139,6 +190,8 @@ static IBindStatusCallback* statusclb_create()
statusclb
*
ret
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
statusclb
));
statusclb
*
ret
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
statusclb
));
ret
->
lpVtbl
=
&
statusclbVtbl
;
ret
->
lpVtbl
=
&
statusclbVtbl
;
ret
->
ref
=
1
;
ret
->
ref
=
1
;
ret
->
pbind
=
NULL
;
ret
->
pstr
=
NULL
;
return
(
IBindStatusCallback
*
)
ret
;
return
(
IBindStatusCallback
*
)
ret
;
}
}
...
@@ -180,8 +233,67 @@ static void test_CreateAsyncBindCtx()
...
@@ -180,8 +233,67 @@ static void test_CreateAsyncBindCtx()
ok
(
ref
==
0
,
"bsc should be destroyed here
\n
"
);
ok
(
ref
==
0
,
"bsc should be destroyed here
\n
"
);
}
}
static
void
test_BindToStorage
()
{
IMoniker
*
mon
;
HRESULT
hres
;
LPOLESTR
display_name
;
IBindCtx
*
bctx
;
MSG
msg
;
IBindStatusCallback
*
previousclb
,
*
sclb
=
statusclb_create
();
IUnknown
*
unk
=
(
IUnknown
*
)
0x00ff00ff
;
hres
=
CreateAsyncBindCtx
(
0
,
sclb
,
NULL
,
&
bctx
);
ok
(
SUCCEEDED
(
hres
),
"CreateAsyncBindCtx failed: %08lx
\n\n
"
,
hres
);
if
(
FAILED
(
hres
))
{
IBindStatusCallback_Release
(
sclb
);
return
;
}
hres
=
RegisterBindStatusCallback
(
bctx
,
sclb
,
&
previousclb
,
0
);
ok
(
SUCCEEDED
(
hres
),
"RegisterBindStatusCallback failed: %08lx
\n
"
,
hres
);
ok
(
previousclb
==
sclb
,
"previousclb(%p) != sclb(%p)
\n
"
,
previousclb
,
sclb
);
if
(
previousclb
)
IBindStatusCallback_Release
(
previousclb
);
hres
=
CreateURLMoniker
(
NULL
,
WINE_ABOUT_URL
,
&
mon
);
ok
(
SUCCEEDED
(
hres
),
"failed to create moniker: %08lx
\n
"
,
hres
);
if
(
FAILED
(
hres
))
{
IBindStatusCallback_Release
(
sclb
);
IBindCtx_Release
(
bctx
);
return
;
}
hres
=
IMoniker_GetDisplayName
(
mon
,
bctx
,
NULL
,
&
display_name
);
ok
(
SUCCEEDED
(
hres
),
"GetDisplayName failed %08lx
\n
"
,
hres
);
ok
(
!
lstrcmpW
(
display_name
,
WINE_ABOUT_URL
),
"GetDisplayName got wrong name
\n
"
);
hres
=
IMoniker_BindToStorage
(
mon
,
bctx
,
NULL
,
&
IID_IStream
,
(
void
**
)
&
unk
);
ok
(
SUCCEEDED
(
hres
),
"IMoniker_BindToStorage failed: %08lx
\n
"
,
hres
);
todo_wine
{
ok
(
unk
==
NULL
,
"istr should be NULL
\n
"
);
}
if
(
FAILED
(
hres
))
{
IBindStatusCallback_Release
(
sclb
);
IMoniker_Release
(
mon
);
return
;
}
if
(
unk
)
IUnknown_Release
(
unk
);
while
(
!
stopped_binding
&&
GetMessage
(
&
msg
,
NULL
,
0
,
0
))
{
TranslateMessage
(
&
msg
);
DispatchMessage
(
&
msg
);
}
ok
(
IMoniker_Release
(
mon
)
==
0
,
"mon should be destroyed here
\n
"
);
ok
(
IBindCtx_Release
(
bctx
)
==
0
,
"bctx should be destroyed here
\n
"
);
ok
(
IBindStatusCallback_Release
(
sclb
)
==
0
,
"scbl should be destroyed here
\n
"
);
}
START_TEST
(
url
)
START_TEST
(
url
)
{
{
test_create
();
test_create
();
test_CreateAsyncBindCtx
();
test_CreateAsyncBindCtx
();
test_BindToStorage
();
}
}
dlls/urlmon/umon.c
View file @
51077d1e
...
@@ -324,6 +324,7 @@ static HRESULT WINAPI URLMonikerImpl_BindToStorage(IMoniker* iface,
...
@@ -324,6 +324,7 @@ static HRESULT WINAPI URLMonikerImpl_BindToStorage(IMoniker* iface,
IBindStatusCallback
*
pbscb
;
IBindStatusCallback
*
pbscb
;
BINDINFO
bi
;
BINDINFO
bi
;
DWORD
bindf
;
DWORD
bindf
;
IStream
*
pstr
;
FIXME
(
"(%p)->(%p,%p,%s,%p): stub
\n
"
,
This
,
pbc
,
pmkToLeft
,
debugstr_guid
(
riid
),
ppvObject
);
FIXME
(
"(%p)->(%p,%p,%s,%p): stub
\n
"
,
This
,
pbc
,
pmkToLeft
,
debugstr_guid
(
riid
),
ppvObject
);
if
(
pmkToLeft
)
{
if
(
pmkToLeft
)
{
...
@@ -339,32 +340,31 @@ static HRESULT WINAPI URLMonikerImpl_BindToStorage(IMoniker* iface,
...
@@ -339,32 +340,31 @@ static HRESULT WINAPI URLMonikerImpl_BindToStorage(IMoniker* iface,
We also need to implement IStream ourselves so that IStream_Read can return
We also need to implement IStream ourselves so that IStream_Read can return
E_PENDING */
E_PENDING */
hres
=
CreateStreamOnHGlobal
(
0
,
TRUE
,
(
IStream
**
)
ppvObject
);
hres
=
CreateStreamOnHGlobal
(
0
,
TRUE
,
&
pstr
);
if
(
SUCCEEDED
(
hres
))
{
if
(
SUCCEEDED
(
hres
))
{
TRACE
(
"Created dummy stream...
\n
"
);
TRACE
(
"Created dummy stream...
\n
"
);
hres
=
IBindCtx_GetObjectParam
(
pbc
,
(
LPOLESTR
)
BSCBHolder
,
(
IUnknown
**
)
&
pbscb
);
hres
=
IBindCtx_GetObjectParam
(
pbc
,
(
LPOLESTR
)
BSCBHolder
,
(
IUnknown
**
)
&
pbscb
);
if
(
SUCCEEDED
(
hres
))
{
if
(
SUCCEEDED
(
hres
))
{
TRACE
(
"Got IBindStatusCallback...
\n
"
);
TRACE
(
"Got IBindStatusCallback...
\n
"
);
memset
(
&
bi
,
0
,
sizeof
(
bi
));
memset
(
&
bi
,
0
,
sizeof
(
bi
));
bi
.
cbSize
=
sizeof
(
bi
);
bi
.
cbSize
=
sizeof
(
bi
);
bindf
=
0
;
bindf
=
0
;
hres
=
IBindStatusCallback_GetBindInfo
(
pbscb
,
&
bindf
,
&
bi
);
hres
=
IBindStatusCallback_GetBindInfo
(
pbscb
,
&
bindf
,
&
bi
);
if
(
SUCCEEDED
(
hres
))
{
if
(
SUCCEEDED
(
hres
))
{
URL_COMPONENTSW
url
;
URL_COMPONENTSW
url
;
WCHAR
*
host
,
*
path
;
WCHAR
*
host
,
*
path
;
DWORD
len
,
lensz
=
sizeof
(
len
),
total_read
=
0
;
DWORD
len
,
lensz
=
sizeof
(
len
),
total_read
=
0
;
LARGE_INTEGER
last_read_pos
;
LARGE_INTEGER
last_read_pos
;
FORMATETC
fmt
;
FORMATETC
fmt
;
STGMEDIUM
stg
;
STGMEDIUM
stg
;
TRACE
(
"got bindinfo. bindf = %08lx extrainfo = %s bindinfof = %08lx bindverb = %08lx iid %s
\n
"
,
TRACE
(
"got bindinfo. bindf = %08lx extrainfo = %s bindinfof = %08lx bindverb = %08lx iid %s
\n
"
,
bindf
,
debugstr_w
(
bi
.
szExtraInfo
),
bi
.
grfBindInfoF
,
bi
.
dwBindVerb
,
debugstr_guid
(
&
bi
.
iid
));
bindf
,
debugstr_w
(
bi
.
szExtraInfo
),
bi
.
grfBindInfoF
,
bi
.
dwBindVerb
,
debugstr_guid
(
&
bi
.
iid
));
hres
=
IBindStatusCallback_OnStartBinding
(
pbscb
,
0
,
(
IBinding
*
)
&
This
->
lpvtbl2
);
hres
=
IBindStatusCallback_OnStartBinding
(
pbscb
,
0
,
(
IBinding
*
)
&
This
->
lpvtbl2
);
TRACE
(
"OnStartBinding rets %08lx
\n
"
,
hres
);
TRACE
(
"OnStartBinding rets %08lx
\n
"
,
hres
);
#if 0
#if 0
if(!registered_wndclass) {
if(!registered_wndclass) {
...
@@ -377,80 +377,81 @@ static HRESULT WINAPI URLMonikerImpl_BindToStorage(IMoniker* iface,
...
@@ -377,80 +377,81 @@ static HRESULT WINAPI URLMonikerImpl_BindToStorage(IMoniker* iface,
URLMON_hInstance, NULL);
URLMON_hInstance, NULL);
#endif
#endif
memset
(
&
url
,
0
,
sizeof
(
url
));
memset
(
&
url
,
0
,
sizeof
(
url
));
url
.
dwStructSize
=
sizeof
(
url
);
url
.
dwStructSize
=
sizeof
(
url
);
url
.
dwSchemeLength
=
url
.
dwHostNameLength
=
url
.
dwUrlPathLength
=
1
;
url
.
dwSchemeLength
=
url
.
dwHostNameLength
=
url
.
dwUrlPathLength
=
1
;
InternetCrackUrlW
(
This
->
URLName
,
0
,
0
,
&
url
);
InternetCrackUrlW
(
This
->
URLName
,
0
,
0
,
&
url
);
host
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
url
.
dwHostNameLength
+
1
)
*
sizeof
(
WCHAR
));
host
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
url
.
dwHostNameLength
+
1
)
*
sizeof
(
WCHAR
));
memcpy
(
host
,
url
.
lpszHostName
,
url
.
dwHostNameLength
*
sizeof
(
WCHAR
));
memcpy
(
host
,
url
.
lpszHostName
,
url
.
dwHostNameLength
*
sizeof
(
WCHAR
));
host
[
url
.
dwHostNameLength
]
=
'\0'
;
host
[
url
.
dwHostNameLength
]
=
'\0'
;
path
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
url
.
dwUrlPathLength
+
1
)
*
sizeof
(
WCHAR
));
path
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
url
.
dwUrlPathLength
+
1
)
*
sizeof
(
WCHAR
));
memcpy
(
path
,
url
.
lpszUrlPath
,
url
.
dwUrlPathLength
*
sizeof
(
WCHAR
));
memcpy
(
path
,
url
.
lpszUrlPath
,
url
.
dwUrlPathLength
*
sizeof
(
WCHAR
));
path
[
url
.
dwUrlPathLength
]
=
'\0'
;
path
[
url
.
dwUrlPathLength
]
=
'\0'
;
This
->
hinternet
=
InternetOpenA
(
"User Agent"
,
0
,
NULL
,
NULL
,
0
/*INTERNET_FLAG_ASYNC*/
);
This
->
hinternet
=
InternetOpenA
(
"User Agent"
,
0
,
NULL
,
NULL
,
0
/*INTERNET_FLAG_ASYNC*/
);
/* InternetSetStatusCallback(This->hinternet, URLMON_InternetCallback);*/
/* InternetSetStatusCallback(This->hinternet, URLMON_InternetCallback);*/
This
->
hconnect
=
InternetConnectW
(
This
->
hinternet
,
host
,
INTERNET_DEFAULT_HTTP_PORT
,
NULL
,
NULL
,
This
->
hconnect
=
InternetConnectW
(
This
->
hinternet
,
host
,
INTERNET_DEFAULT_HTTP_PORT
,
NULL
,
NULL
,
INTERNET_SERVICE_HTTP
,
0
,
(
DWORD
)
This
);
INTERNET_SERVICE_HTTP
,
0
,
(
DWORD
)
This
);
This
->
hrequest
=
HttpOpenRequestW
(
This
->
hconnect
,
NULL
,
path
,
NULL
,
NULL
,
NULL
,
0
,
(
DWORD
)
This
);
This
->
hrequest
=
HttpOpenRequestW
(
This
->
hconnect
,
NULL
,
path
,
NULL
,
NULL
,
NULL
,
0
,
(
DWORD
)
This
);
hres
=
IBindStatusCallback_OnProgress
(
pbscb
,
0
,
0
,
0x22
,
NULL
);
hres
=
IBindStatusCallback_OnProgress
(
pbscb
,
0
,
0
,
0x22
,
NULL
);
hres
=
IBindStatusCallback_OnProgress
(
pbscb
,
0
,
0
,
BINDSTATUS_FINDINGRESOURCE
,
NULL
);
hres
=
IBindStatusCallback_OnProgress
(
pbscb
,
0
,
0
,
BINDSTATUS_FINDINGRESOURCE
,
NULL
);
hres
=
IBindStatusCallback_OnProgress
(
pbscb
,
0
,
0
,
BINDSTATUS_CONNECTING
,
NULL
);
hres
=
IBindStatusCallback_OnProgress
(
pbscb
,
0
,
0
,
BINDSTATUS_CONNECTING
,
NULL
);
hres
=
IBindStatusCallback_OnProgress
(
pbscb
,
0
,
0
,
BINDSTATUS_SENDINGREQUEST
,
NULL
);
hres
=
IBindStatusCallback_OnProgress
(
pbscb
,
0
,
0
,
BINDSTATUS_SENDINGREQUEST
,
NULL
);
hres
=
E_OUTOFMEMORY
;
/* FIXME */
hres
=
E_OUTOFMEMORY
;
/* FIXME */
if
(
HttpSendRequestW
(
This
->
hrequest
,
NULL
,
0
,
NULL
,
0
))
{
if
(
HttpSendRequestW
(
This
->
hrequest
,
NULL
,
0
,
NULL
,
0
))
{
len
=
0
;
len
=
0
;
HttpQueryInfoW
(
This
->
hrequest
,
HTTP_QUERY_CONTENT_LENGTH
|
HTTP_QUERY_FLAG_NUMBER
,
&
len
,
&
lensz
,
NULL
);
HttpQueryInfoW
(
This
->
hrequest
,
HTTP_QUERY_CONTENT_LENGTH
|
HTTP_QUERY_FLAG_NUMBER
,
&
len
,
&
lensz
,
NULL
);
TRACE
(
"res = %ld gle = %08lx url len = %ld
\n
"
,
hres
,
GetLastError
(),
len
);
TRACE
(
"res = %ld gle = %08lx url len = %ld
\n
"
,
hres
,
GetLastError
(),
len
);
last_read_pos
.
u
.
LowPart
=
last_read_pos
.
u
.
HighPart
=
0
;
last_read_pos
.
u
.
LowPart
=
last_read_pos
.
u
.
HighPart
=
0
;
fmt
.
cfFormat
=
0
;
fmt
.
cfFormat
=
0
;
fmt
.
ptd
=
NULL
;
fmt
.
ptd
=
NULL
;
fmt
.
dwAspect
=
0
;
fmt
.
dwAspect
=
0
;
fmt
.
lindex
=
-
1
;
fmt
.
lindex
=
-
1
;
fmt
.
tymed
=
TYMED_ISTREAM
;
fmt
.
tymed
=
TYMED_ISTREAM
;
stg
.
tymed
=
TYMED_ISTREAM
;
stg
.
tymed
=
TYMED_ISTREAM
;
stg
.
u
.
pstm
=
pstr
;
stg
.
u
.
pstm
=
*
(
IStream
**
)
ppvObject
;
stg
.
pUnkForRelease
=
NULL
;
stg
.
pUnkForRelease
=
NULL
;
while
(
1
)
{
while
(
1
)
{
char
buf
[
4096
];
char
buf
[
4096
];
DWORD
bufread
;
DWORD
bufread
;
DWORD
written
;
DWORD
written
;
if
(
InternetReadFile
(
This
->
hrequest
,
buf
,
sizeof
(
buf
),
&
bufread
))
{
if
(
InternetReadFile
(
This
->
hrequest
,
buf
,
sizeof
(
buf
),
&
bufread
))
{
TRACE
(
"read %ld bytes %s...
\n
"
,
bufread
,
debugstr_an
(
buf
,
10
));
TRACE
(
"read %ld bytes %s...
\n
"
,
bufread
,
debugstr_an
(
buf
,
10
));
if
(
bufread
==
0
)
break
;
if
(
bufread
==
0
)
break
;
IStream_Write
(
pstr
,
buf
,
bufread
,
&
written
);
IStream_Write
(
*
(
IStream
**
)
ppvObject
,
buf
,
bufread
,
&
written
);
total_read
+=
bufread
;
total_read
+=
bufread
;
IStream_Seek
(
pstr
,
last_read_pos
,
STREAM_SEEK_SET
,
NULL
);
IStream_Seek
(
*
(
IStream
**
)
ppvObject
,
last_read_pos
,
STREAM_SEEK_SET
,
NULL
);
hres
=
IBindStatusCallback_OnProgress
(
pbscb
,
total_read
,
len
,
(
total_read
==
bufread
)
?
hres
=
IBindStatusCallback_OnProgress
(
pbscb
,
total_read
,
len
,
(
total_read
==
bufread
)
?
BINDSTATUS_BEGINDOWNLOADDATA
:
BINDSTATUS_BEGINDOWNLOADDATA
:
BINDSTATUS_DOWNLOADINGDATA
,
NULL
);
BINDSTATUS_DOWNLOADINGDATA
,
NULL
);
hres
=
IBindStatusCallback_OnDataAvailable
(
pbscb
,
hres
=
IBindStatusCallback_OnDataAvailable
(
pbscb
,
(
total_read
==
bufread
)
?
BSCF_FIRSTDATANOTIFICATION
:
(
total_read
==
bufread
)
?
BSCF_FIRSTDATANOTIFICATION
:
BSCF_INTERMEDIATEDATANOTIFICATION
,
BSCF_INTERMEDIATEDATANOTIFICATION
,
total_read
,
&
fmt
,
&
stg
);
total_read
,
&
fmt
,
&
stg
);
last_read_pos
.
u
.
LowPart
+=
bufread
;
/* FIXME */
last_read_pos
.
u
.
LowPart
+=
bufread
;
/* FIXME */
}
else
}
else
break
;
break
;
}
}
hres
=
IBindStatusCallback_OnProgress
(
pbscb
,
total_read
,
len
,
BINDSTATUS_ENDDOWNLOADDATA
,
NULL
);
hres
=
IBindStatusCallback_OnProgress
(
pbscb
,
total_read
,
len
,
BINDSTATUS_ENDDOWNLOADDATA
,
NULL
);
hres
=
IBindStatusCallback_OnDataAvailable
(
pbscb
,
BSCF_LASTDATANOTIFICATION
,
total_read
,
&
fmt
,
&
stg
);
hres
=
IBindStatusCallback_OnDataAvailable
(
pbscb
,
BSCF_LASTDATANOTIFICATION
,
total_read
,
&
fmt
,
&
stg
);
TRACE
(
"OnDataAvail rets %08lx
\n
"
,
hres
);
TRACE
(
"OnDataAvail rets %08lx
\n
"
,
hres
);
hres
=
IBindStatusCallback_OnStopBinding
(
pbscb
,
S_OK
,
NULL
);
hres
=
IBindStatusCallback_OnStopBinding
(
pbscb
,
S_OK
,
NULL
);
TRACE
(
"OnStop rets %08lx
\n
"
,
hres
);
TRACE
(
"OnStop rets %08lx
\n
"
,
hres
);
hres
=
S_OK
;
hres
=
S_OK
;
}
}
InternetCloseHandle
(
This
->
hrequest
);
InternetCloseHandle
(
This
->
hrequest
);
InternetCloseHandle
(
This
->
hconnect
);
InternetCloseHandle
(
This
->
hconnect
);
InternetCloseHandle
(
This
->
hinternet
);
InternetCloseHandle
(
This
->
hinternet
);
}
IBindStatusCallback_Release
(
pbscb
);
}
}
}
}
}
*
ppvObject
=
(
VOID
*
)
pstr
;
return
hres
;
return
hres
;
}
}
...
@@ -752,7 +753,7 @@ static HRESULT WINAPI URLMonikerImpl_IBinding_Abort(IBinding* iface)
...
@@ -752,7 +753,7 @@ static HRESULT WINAPI URLMonikerImpl_IBinding_Abort(IBinding* iface)
static
HRESULT
WINAPI
URLMonikerImpl_IBinding_GetBindResult
(
IBinding
*
iface
,
CLSID
*
pclsidProtocol
,
DWORD
*
pdwResult
,
LPOLESTR
*
pszResult
,
DWORD
*
pdwReserved
)
static
HRESULT
WINAPI
URLMonikerImpl_IBinding_GetBindResult
(
IBinding
*
iface
,
CLSID
*
pclsidProtocol
,
DWORD
*
pdwResult
,
LPOLESTR
*
pszResult
,
DWORD
*
pdwReserved
)
{
{
ICOM_THIS_MULTI
(
URLMonikerImpl
,
lpvtbl2
,
iface
);
ICOM_THIS_MULTI
(
URLMonikerImpl
,
lpvtbl2
,
iface
);
FIXME
(
"(%p)->(%
s, %p, %p, %p): stub
\n
"
,
This
,
debugstr_guid
(
pclsidProtocol
)
,
pdwResult
,
pszResult
,
pdwReserved
);
FIXME
(
"(%p)->(%
p, %p, %p, %p): stub
\n
"
,
This
,
pclsidProtocol
,
pdwResult
,
pszResult
,
pdwReserved
);
return
E_NOTIMPL
;
return
E_NOTIMPL
;
}
}
...
...
include/urlmon.idl
View file @
51077d1e
...
@@ -73,6 +73,13 @@ interface IBindStatusCallback : IUnknown
...
@@ -73,6 +73,13 @@ interface IBindStatusCallback : IUnknown
{
{
typedef
[
unique
]
IBindStatusCallback
*
LPBINDSTATUSCALLBACK
;
typedef
[
unique
]
IBindStatusCallback
*
LPBINDSTATUSCALLBACK
;
typedef
enum
{
BINDVERB_GET
=
0
x00000000
,
BINDVERB_POST
=
0
x00000001
,
BINDVERB_PUT
=
0
x00000002
,
BINDVERB_CUSTOM
=
0
x00000003
}
BINDVERB
;
typedef
enum
typedef
enum
{
{
...
@@ -265,6 +272,24 @@ interface IBindStatusCallback : IUnknown
...
@@ -265,6 +272,24 @@ interface IBindStatusCallback : IUnknown
[
in
,
iid_is
(
riid
)
]
IUnknown
*
punk
)
;
[
in
,
iid_is
(
riid
)
]
IUnknown
*
punk
)
;
}
}
/*****************************************************************************
*
IAuthenticate
interface
*/
[
local
,
object
,
uuid
(
79
EAC9D0
-
BAf9
-
11
CE
-
8
C82
-
00
AA004BA90B
),
pointer_default
(
unique
)
]
interface
IAuthenticate
:
IUnknown
{
typedef
[
unique
]
IAuthenticate
*
LPAUTHENTICATION
;
HRESULT
Authenticate
(
[
out
]
HWND
*
phwnd
,
[
out
]
LPWSTR
*
pszUsername
,
[
out
]
LPWSTR
*
pszPassword
)
;
}
/*****************************************************************************
/*****************************************************************************
*
IBindHost
interface
*
IBindHost
interface
...
@@ -791,6 +816,7 @@ interface IInternetZoneManager : IUnknown
...
@@ -791,6 +816,7 @@ interface IInternetZoneManager : IUnknown
cpp_quote
(
"DEFINE_GUID(CLSID_InternetSecurityManager, 0x7b8a2d94, 0x0ac9, 0x11d1, 0x89, 0x6c, 0x00, 0xc0, 0x4f, 0xB6, 0xbf, 0xc4);"
)
cpp_quote
(
"DEFINE_GUID(CLSID_InternetSecurityManager, 0x7b8a2d94, 0x0ac9, 0x11d1, 0x89, 0x6c, 0x00, 0xc0, 0x4f, 0xB6, 0xbf, 0xc4);"
)
cpp_quote
(
"DEFINE_GUID(CLSID_InternetZoneManager, 0x7B8A2D95, 0x0AC9, 0x11D1, 0x89, 0x6C, 0x00, 0xC0, 0x4F, 0xB6, 0xBF, 0xC4);"
)
cpp_quote
(
"DEFINE_GUID(CLSID_InternetZoneManager, 0x7B8A2D95, 0x0AC9, 0x11D1, 0x89, 0x6C, 0x00, 0xC0, 0x4F, 0xB6, 0xBF, 0xC4);"
)
cpp_quote
(
"DEFINE_GUID(IID_IAsyncMoniker, 0x79EAC9D3, 0xBAF9, 0x11CE, 0x8C, 0x82, 0x00, 0xAA, 0x00, 0x4B, 0xA9, 0x0B);"
)
cpp_quote
(
"DEFINE_GUID(IID_IAsyncMoniker, 0x79EAC9D3, 0xBAF9, 0x11CE, 0x8C, 0x82, 0x00, 0xAA, 0x00, 0x4B, 0xA9, 0x0B);"
)
cpp_quote
(
"DEFINE_GUID(IID_IAsyncBindCtx, 0x79EAC9D4, 0xBAF9, 0x11CE, 0x8C, 0x82, 0x00, 0xAA, 0x00, 0x4B, 0xA9, 0x0B);"
)
cpp_quote
(
"DEFINE_GUID(CLSID_StdURLMoniker, 0x79EAC9E0, 0xBAF9, 0x11CE, 0x8C, 0x82, 0x00, 0xAA, 0x00, 0x4B, 0xA9, 0x0B);"
)
cpp_quote
(
"DEFINE_GUID(CLSID_StdURLMoniker, 0x79EAC9E0, 0xBAF9, 0x11CE, 0x8C, 0x82, 0x00, 0xAA, 0x00, 0x4B, 0xA9, 0x0B);"
)
cpp_quote
(
"#define MK_S_ASYNCHRONOUS 0x000401E8"
)
cpp_quote
(
"#define MK_S_ASYNCHRONOUS 0x000401E8"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment