Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Felix Münchhalfen
wine
Commits
7af955a1
Commit
7af955a1
authored
20 years ago
by
Jacek Caban
Committed by
Alexandre Julliard
20 years ago
Browse files
Options
Downloads
Patches
Plain Diff
- Implemented CreateAsyncBindCtx.
- Added test.
parent
0e9f423b
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dlls/urlmon/tests/url.c
+131
-2
131 additions, 2 deletions
dlls/urlmon/tests/url.c
dlls/urlmon/umon.c
+31
-3
31 additions, 3 deletions
dlls/urlmon/umon.c
with
162 additions
and
5 deletions
dlls/urlmon/tests/url.c
+
131
−
2
View file @
7af955a1
...
...
@@ -2,6 +2,7 @@
* UrlMon URL tests
*
* Copyright 2004 Kevin Koltzau
* Copyright 2004 Jacek Caban
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -28,8 +29,8 @@
#include
"wine/test.h"
const
WCHAR
TEST_URL_1
[]
=
{
'h'
,
't'
,
't'
,
'p'
,
':'
,
'/'
,
'/'
,
'w'
,
'w'
,
'w'
,
'.'
,
'w'
,
'i'
,
'n'
,
'e'
,
'h'
,
'q'
,
'.'
,
'o'
,
'r'
,
'g'
,
'/'
,
'\0'
};
const
WCHAR
TEST_PART_URL_1
[]
=
{
'/'
,
't'
,
'e'
,
's'
,
't'
,
'/'
,
'\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
void
test_CreateURLMoniker
(
LPCWSTR
url1
,
LPCWSTR
url2
)
{
...
...
@@ -52,7 +53,135 @@ static void test_create()
test_CreateURLMoniker
(
TEST_URL_1
,
TEST_PART_URL_1
);
}
typedef
struct
{
IBindStatusCallbackVtbl
*
lpVtbl
;
ULONG
ref
;
}
statusclb
;
static
HRESULT
WINAPI
statusclb_QueryInterface
(
IBindStatusCallback
*
iface
,
REFIID
riid
,
void
**
ppvObject
)
{
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
statusclb_AddRef
(
IBindStatusCallback
*
iface
)
{
return
InterlockedIncrement
(
&
((
statusclb
*
)
iface
)
->
ref
);
}
static
ULONG
WINAPI
statusclb_Release
(
IBindStatusCallback
*
iface
)
{
statusclb
*
This
=
(
statusclb
*
)
iface
;
ULONG
ref
;
ref
=
InterlockedDecrement
(
&
This
->
ref
);
if
(
!
ref
)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
ref
;
}
static
HRESULT
WINAPI
statusclb_OnStartBinding
(
IBindStatusCallback
*
iface
,
DWORD
dwReserved
,
IBinding
*
pib
)
{
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
statusclb_GetPriority
(
IBindStatusCallback
*
iface
,
LONG
*
pnPriority
)
{
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
statusclb_OnLowResource
(
IBindStatusCallback
*
iface
,
DWORD
reserved
)
{
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
statusclb_OnProgress
(
IBindStatusCallback
*
iface
,
ULONG
ulProgress
,
ULONG
ulProgressMax
,
ULONG
ulStatusCode
,
LPCWSTR
szStatusText
)
{
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
statusclb_OnStopBinding
(
IBindStatusCallback
*
iface
,
HRESULT
hresult
,
LPCWSTR
szError
)
{
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
statusclb_GetBindInfo
(
IBindStatusCallback
*
iface
,
DWORD
*
grfBINDF
,
BINDINFO
*
pbindinfo
)
{
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
statusclb_OnDataAvailable
(
IBindStatusCallback
*
iface
,
DWORD
grfBSCF
,
DWORD
dwSize
,
FORMATETC
*
pformatetc
,
STGMEDIUM
*
pstgmed
)
{
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
statusclb_OnObjectAvailable
(
IBindStatusCallback
*
iface
,
REFIID
riid
,
IUnknown
*
punk
)
{
return
E_NOTIMPL
;
}
static
IBindStatusCallbackVtbl
statusclbVtbl
=
{
statusclb_QueryInterface
,
statusclb_AddRef
,
statusclb_Release
,
statusclb_OnStartBinding
,
statusclb_GetPriority
,
statusclb_OnLowResource
,
statusclb_OnProgress
,
statusclb_OnStopBinding
,
statusclb_GetBindInfo
,
statusclb_OnDataAvailable
,
statusclb_OnObjectAvailable
};
static
IBindStatusCallback
*
statusclb_create
()
{
statusclb
*
ret
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
statusclb
));
ret
->
lpVtbl
=
&
statusclbVtbl
;
ret
->
ref
=
1
;
return
(
IBindStatusCallback
*
)
ret
;
}
static
void
test_CreateAsyncBindCtx
()
{
IBindCtx
*
bctx
=
(
IBindCtx
*
)
0x0ff00ff0
;
HRESULT
hres
;
ULONG
ref
;
BIND_OPTS
bindopts
;
IBindStatusCallback
*
bsc
=
statusclb_create
();
hres
=
CreateAsyncBindCtx
(
0
,
NULL
,
NULL
,
&
bctx
);
ok
(
hres
==
E_INVALIDARG
,
"CreateAsyncBindCtx failed. expected: E_INVALIDARG, got: %08lx
\n
"
,
hres
);
ok
(
bctx
==
(
IBindCtx
*
)
0x0ff00ff0
,
"bctx should not be changed
\n
"
);
hres
=
CreateAsyncBindCtx
(
0
,
NULL
,
NULL
,
NULL
);
ok
(
hres
==
E_INVALIDARG
,
"CreateAsyncBindCtx failed. expected: E_INVALIDARG, got: %08lx
\n
"
,
hres
);
hres
=
CreateAsyncBindCtx
(
0
,
bsc
,
NULL
,
&
bctx
);
ok
(
SUCCEEDED
(
hres
),
"CreateAsyncBindCtx failed: %08lx
\n
"
,
hres
);
if
(
FAILED
(
hres
))
{
IBindStatusCallback_Release
(
bsc
);
return
;
}
bindopts
.
cbStruct
=
16
;
hres
=
IBindCtx_GetBindOptions
(
bctx
,
&
bindopts
);
ok
(
SUCCEEDED
(
hres
),
"IBindCtx_GetBindOptions failed: %08lx
\n
"
,
hres
);
ok
(
bindopts
.
grfFlags
==
BIND_MAYBOTHERUSER
,
"bindopts.grfFlags = %08lx, expected: BIND_MAYBOTHERUSER
\n
"
,
bindopts
.
grfFlags
);
ok
(
bindopts
.
grfMode
=
STGM_READWRITE
|
STGM_SHARE_EXCLUSIVE
,
"bindopts.grfMode = %08lx, expected: STGM_READWRITE | STGM_SHARE_EXCLUSIVE
\n
"
,
bindopts
.
grfMode
);
ok
(
bindopts
.
dwTickCountDeadline
==
0
,
"bindopts.dwTickCountDeadline = %08lx, expected: 0
\n
"
,
bindopts
.
dwTickCountDeadline
);
ref
=
IBindCtx_Release
(
bctx
);
ok
(
ref
==
0
,
"bctx should be destroyed here
\n
"
);
ref
=
IBindStatusCallback_Release
(
bsc
);
ok
(
ref
==
0
,
"bsc should be destroyed here
\n
"
);
}
START_TEST
(
url
)
{
test_create
();
test_CreateAsyncBindCtx
();
}
This diff is collapsed.
Click to expand it.
dlls/urlmon/umon.c
+
31
−
3
View file @
7af955a1
...
...
@@ -882,8 +882,36 @@ static HRESULT URLMonikerImpl_Construct(URLMonikerImpl* This, LPCOLESTR lpszLeft
HRESULT
WINAPI
CreateAsyncBindCtx
(
DWORD
reserved
,
IBindStatusCallback
*
callback
,
IEnumFORMATETC
*
format
,
IBindCtx
**
pbind
)
{
FIXME
(
"stub.
\n
"
);
return
E_INVALIDARG
;
HRESULT
hres
;
BIND_OPTS
bindopts
;
IBindCtx
*
bctx
;
TRACE
(
"(%08lx %p %p %p)
\n
"
,
reserved
,
callback
,
format
,
pbind
);
if
(
!
callback
)
return
E_INVALIDARG
;
if
(
format
)
FIXME
(
"format is not supported yet
\n
"
);
hres
=
CreateBindCtx
(
0
,
&
bctx
);
if
(
FAILED
(
hres
))
return
hres
;
bindopts
.
cbStruct
=
sizeof
(
BIND_OPTS
);
bindopts
.
grfFlags
=
BIND_MAYBOTHERUSER
;
bindopts
.
grfMode
=
STGM_READWRITE
|
STGM_SHARE_EXCLUSIVE
;
bindopts
.
dwTickCountDeadline
=
0
;
IBindCtx_SetBindOptions
(
bctx
,
&
bindopts
);
hres
=
IBindCtx_RegisterObjectParam
(
bctx
,
(
LPOLESTR
)
BSCBHolder
,
(
IUnknown
*
)
callback
);
if
(
FAILED
(
hres
))
{
IBindCtx_Release
(
bctx
);
return
hres
;
}
*
pbind
=
bctx
;
return
S_OK
;
}
/***********************************************************************
* CreateAsyncBindCtxEx (URLMON.@)
...
...
@@ -892,7 +920,7 @@ HRESULT WINAPI CreateAsyncBindCtx(DWORD reserved, IBindStatusCallback *callback,
*
* FIXME
* Not implemented.
*/
*/
HRESULT
WINAPI
CreateAsyncBindCtxEx
(
IBindCtx
*
ibind
,
DWORD
options
,
IBindStatusCallback
*
callback
,
IEnumFORMATETC
*
format
,
IBindCtx
**
pbind
,
DWORD
reserved
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment