Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
3d5205ef
Commit
3d5205ef
authored
May 03, 2004
by
Kevin Koltzau
Committed by
Alexandre Julliard
May 03, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle context in CreateURLMoniker.
parent
199877a6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
98 additions
and
12 deletions
+98
-12
Makefile.in
dlls/urlmon/Makefile.in
+1
-1
.cvsignore
dlls/urlmon/tests/.cvsignore
+1
-0
Makefile.in
dlls/urlmon/tests/Makefile.in
+2
-1
url.c
dlls/urlmon/tests/url.c
+55
-0
umon.c
dlls/urlmon/umon.c
+39
-10
No files found.
dlls/urlmon/Makefile.in
View file @
3d5205ef
...
...
@@ -3,7 +3,7 @@ TOPOBJDIR = ../..
SRCDIR
=
@srcdir@
VPATH
=
@srcdir@
MODULE
=
urlmon.dll
IMPORTS
=
cabinet ole32 wininet user32 advapi32 kernel32 ntdll
IMPORTS
=
cabinet ole32
shlwapi
wininet user32 advapi32 kernel32 ntdll
EXTRALIBS
=
-luuid
C_SRCS
=
\
...
...
dlls/urlmon/tests/.cvsignore
View file @
3d5205ef
Makefile
generated.ok
testlist.c
url.ok
dlls/urlmon/tests/Makefile.in
View file @
3d5205ef
...
...
@@ -6,7 +6,8 @@ TESTDLL = urlmon.dll
IMPORTS
=
urlmon
CTESTS
=
\
generated.c
generated.c
\
url.c
@MAKE_TEST_RULES@
...
...
dlls/urlmon/tests/url.c
0 → 100644
View file @
3d5205ef
/*
* UrlMon URL tests
*
* Copyright 2004 Kevin Koltzau
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "urlmon.h"
#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
void
test_CreateURLMoniker
(
LPCWSTR
url1
,
LPCWSTR
url2
)
{
HRESULT
hr
;
IMoniker
*
mon1
=
NULL
;
IMoniker
*
mon2
=
NULL
;
hr
=
CreateURLMoniker
(
NULL
,
url1
,
&
mon1
);
ok
(
SUCCEEDED
(
hr
),
"failed to create moniker: 0x%08lx
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
CreateURLMoniker
(
mon1
,
url2
,
&
mon2
);
ok
(
SUCCEEDED
(
hr
),
"failed to create moniker: 0x%08lx
\n
"
,
hr
);
}
if
(
mon1
)
IMoniker_Release
(
mon1
);
if
(
mon2
)
IMoniker_Release
(
mon2
);
}
static
void
test_create
()
{
test_CreateURLMoniker
(
TEST_URL_1
,
TEST_PART_URL_1
);
}
START_TEST
(
url
)
{
test_create
();
}
dlls/urlmon/umon.c
View file @
3d5205ef
...
...
@@ -36,6 +36,7 @@
#include "ole2.h"
#include "urlmon.h"
#include "wininet.h"
#include "shlwapi.h"
#include "urlmon_main.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
urlmon
);
...
...
@@ -106,7 +107,7 @@ static HRESULT WINAPI URLMonikerImpl_IBinding_GetPriority(IBinding* iface, LONG*
static
HRESULT
WINAPI
URLMonikerImpl_IBinding_GetBindResult
(
IBinding
*
iface
,
CLSID
*
pclsidProtocol
,
DWORD
*
pdwResult
,
LPOLESTR
*
pszResult
,
DWORD
*
pdwReserved
);
/* Local function used by urlmoniker implementation */
static
HRESULT
URLMonikerImpl_Construct
(
URLMonikerImpl
*
iface
,
LPCOLESTR
lpszURL
);
static
HRESULT
URLMonikerImpl_Construct
(
URLMonikerImpl
*
iface
,
LPCOLESTR
lpsz
LeftURL
,
LPCOLESTR
lpsz
URL
);
static
HRESULT
URLMonikerImpl_Destroy
(
URLMonikerImpl
*
iface
);
/********************************************************************************/
...
...
@@ -337,11 +338,12 @@ static HRESULT WINAPI URLMonikerImpl_GetSizeMax(IMoniker* iface,
/******************************************************************************
* URLMoniker_Construct (local function)
*******************************************************************************/
static
HRESULT
URLMonikerImpl_Construct
(
URLMonikerImpl
*
This
,
LPCOLESTR
lpszURLName
)
static
HRESULT
URLMonikerImpl_Construct
(
URLMonikerImpl
*
This
,
LPCOLESTR
lpsz
LeftURLName
,
LPCOLESTR
lpsz
URLName
)
{
int
sizeStr
=
strlenW
(
lpszURLName
);
HRESULT
hres
;
DWORD
sizeStr
;
TRACE
(
"(%p,%s
)
\n
"
,
This
,
debugstr_w
(
lpszURLName
));
TRACE
(
"(%p,%s
,%s)
\n
"
,
This
,
debugstr_w
(
lpszLeftURLName
)
,
debugstr_w
(
lpszURLName
));
memset
(
This
,
0
,
sizeof
(
*
This
));
/* Initialize the virtual function table. */
...
...
@@ -349,12 +351,30 @@ static HRESULT URLMonikerImpl_Construct(URLMonikerImpl* This, LPCOLESTR lpszURLN
This
->
lpvtbl2
=
&
VTBinding_URLMonikerImpl
;
This
->
ref
=
0
;
This
->
URLName
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
WCHAR
)
*
(
sizeStr
+
1
));
if
(
lpszLeftURLName
)
{
hres
=
UrlCombineW
(
lpszLeftURLName
,
lpszURLName
,
NULL
,
&
sizeStr
,
0
);
if
(
FAILED
(
hres
))
{
return
hres
;
}
sizeStr
++
;
}
else
sizeStr
=
lstrlenW
(
lpszURLName
)
+
1
;
This
->
URLName
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
WCHAR
)
*
(
sizeStr
));
if
(
This
->
URLName
==
NULL
)
return
E_OUTOFMEMORY
;
strcpyW
(
This
->
URLName
,
lpszURLName
);
if
(
lpszLeftURLName
)
{
hres
=
UrlCombineW
(
lpszLeftURLName
,
lpszURLName
,
This
->
URLName
,
&
sizeStr
,
0
);
if
(
FAILED
(
hres
))
{
HeapFree
(
GetProcessHeap
(),
0
,
This
->
URLName
);
return
hres
;
}
}
else
strcpyW
(
This
->
URLName
,
lpszURLName
);
return
S_OK
;
}
...
...
@@ -967,16 +987,25 @@ HRESULT WINAPI CreateURLMoniker(IMoniker *pmkContext, LPCWSTR szURL, IMoniker **
URLMonikerImpl
*
obj
;
HRESULT
hres
;
IID
iid
=
IID_IMoniker
;
LPOLESTR
lefturl
=
NULL
;
TRACE
(
"(%p, %s, %p)
\n
"
,
pmkContext
,
debugstr_w
(
szURL
),
ppmk
);
if
(
NULL
!=
pmkContext
)
FIXME
(
"Non-null pmkContext not implemented
\n
"
);
if
(
!
(
obj
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
obj
))))
return
E_OUTOFMEMORY
;
hres
=
URLMonikerImpl_Construct
(
obj
,
szURL
);
if
(
pmkContext
)
{
CLSID
clsid
;
IBindCtx
*
bind
;
IMoniker_GetClassID
(
pmkContext
,
&
clsid
);
if
(
IsEqualCLSID
(
&
clsid
,
&
CLSID_StdURLMoniker
)
&&
SUCCEEDED
(
CreateBindCtx
(
0
,
&
bind
)))
{
URLMonikerImpl_GetDisplayName
(
pmkContext
,
bind
,
NULL
,
&
lefturl
);
IBindCtx_Release
(
bind
);
}
}
hres
=
URLMonikerImpl_Construct
(
obj
,
lefturl
,
szURL
);
CoTaskMemFree
(
lefturl
);
if
(
SUCCEEDED
(
hres
))
hres
=
URLMonikerImpl_QueryInterface
((
IMoniker
*
)
obj
,
&
iid
,
(
void
**
)
ppmk
);
else
...
...
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