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
9630d155
Commit
9630d155
authored
Nov 14, 2005
by
Jacek Caban
Committed by
Alexandre Julliard
Nov 14, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added get_protocol_iface internal function and use it in
get_protocol_info.
parent
4665deda
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
36 deletions
+54
-36
internet.c
dlls/urlmon/internet.c
+5
-36
session.c
dlls/urlmon/session.c
+47
-0
urlmon_main.h
dlls/urlmon/urlmon_main.h
+2
-0
No files found.
dlls/urlmon/internet.c
View file @
9630d155
...
...
@@ -64,47 +64,16 @@ static HRESULT parse_schema(LPCWSTR url, DWORD flags, LPWSTR result, DWORD size,
static
IInternetProtocolInfo
*
get_protocol_info
(
LPCWSTR
url
)
{
IInternetProtocolInfo
*
ret
=
NULL
;
WCHAR
schema
[
64
],
str_clsid
[
64
];
HKEY
hkey
=
NULL
;
DWORD
res
,
type
,
size
,
schema_len
;
CLSID
clsid
;
LPWSTR
wszKey
;
IUnknown
*
unk
;
HRESULT
hres
;
static
const
WCHAR
wszProtocolsKey
[]
=
{
'P'
,
'R'
,
'O'
,
'T'
,
'O'
,
'C'
,
'O'
,
'L'
,
'S'
,
'\\'
,
'H'
,
'a'
,
'n'
,
'd'
,
'l'
,
'e'
,
'r'
,
'\\'
};
static
const
WCHAR
wszCLSID
[]
=
{
'C'
,
'L'
,
'S'
,
'I'
,
'D'
,
0
};
hres
=
parse_schema
(
url
,
0
,
schema
,
sizeof
(
schema
)
/
sizeof
(
schema
[
0
]),
&
schema_len
);
if
(
FAILED
(
hres
)
||
!
schema_len
)
return
NULL
;
wszKey
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
wszProtocolsKey
)
+
(
schema_len
+
1
)
*
sizeof
(
WCHAR
));
memcpy
(
wszKey
,
wszProtocolsKey
,
sizeof
(
wszProtocolsKey
));
memcpy
(
wszKey
+
sizeof
(
wszProtocolsKey
)
/
sizeof
(
WCHAR
),
schema
,
(
schema_len
+
1
)
*
sizeof
(
WCHAR
));
res
=
RegOpenKeyW
(
HKEY_CLASSES_ROOT
,
wszKey
,
&
hkey
);
HeapFree
(
GetProcessHeap
(),
0
,
wszKey
);
if
(
res
!=
ERROR_SUCCESS
)
{
TRACE
(
"Could not open key %s
\n
"
,
debugstr_w
(
wszKey
));
return
NULL
;
}
size
=
sizeof
(
str_clsid
);
res
=
RegQueryValueExW
(
hkey
,
wszCLSID
,
NULL
,
&
type
,
(
LPBYTE
)
str_clsid
,
&
size
);
RegCloseKey
(
hkey
);
if
(
res
!=
ERROR_SUCCESS
||
type
!=
REG_SZ
)
{
WARN
(
"Could not get protocol CLSID res=%ld
\n
"
,
res
);
hres
=
get_protocol_iface
(
url
,
&
unk
);
if
(
FAILED
(
hres
))
return
NULL
;
}
hres
=
CLSIDFromString
(
str_clsid
,
&
clsid
);
if
(
FAILED
(
hres
))
{
WARN
(
"CLSIDFromString failed: %08lx
\n
"
,
hres
);
return
NULL
;
}
IUnknown_QueryInterface
(
unk
,
&
IID_IInternetProtocolInfo
,
(
void
**
)
&
ret
);
IUnknown_Release
(
unk
);
CoGetClassObject
(
&
clsid
,
CLSCTX_INPROC_SERVER
,
NULL
,
&
IID_IInternetProtocolInfo
,
(
void
**
)
&
ret
);
return
ret
;
}
...
...
dlls/urlmon/session.c
View file @
9630d155
...
...
@@ -23,6 +23,7 @@
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "winreg.h"
#include "ole2.h"
#include "urlmon.h"
#include "urlmon_main.h"
...
...
@@ -31,6 +32,52 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
urlmon
);
HRESULT
get_protocol_iface
(
LPCWSTR
url
,
IUnknown
**
ret
)
{
WCHAR
schema
[
64
],
str_clsid
[
64
];
HKEY
hkey
=
NULL
;
DWORD
res
,
type
,
size
,
schema_len
;
CLSID
clsid
;
LPWSTR
wszKey
;
HRESULT
hres
;
static
const
WCHAR
wszProtocolsKey
[]
=
{
'P'
,
'R'
,
'O'
,
'T'
,
'O'
,
'C'
,
'O'
,
'L'
,
'S'
,
'\\'
,
'H'
,
'a'
,
'n'
,
'd'
,
'l'
,
'e'
,
'r'
,
'\\'
};
static
const
WCHAR
wszCLSID
[]
=
{
'C'
,
'L'
,
'S'
,
'I'
,
'D'
,
0
};
hres
=
CoInternetParseUrl
(
url
,
PARSE_SCHEMA
,
0
,
schema
,
sizeof
(
schema
)
/
sizeof
(
schema
[
0
]),
&
schema_len
,
0
);
if
(
FAILED
(
hres
)
||
!
schema_len
)
return
E_FAIL
;
wszKey
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
wszProtocolsKey
)
+
(
schema_len
+
1
)
*
sizeof
(
WCHAR
));
memcpy
(
wszKey
,
wszProtocolsKey
,
sizeof
(
wszProtocolsKey
));
memcpy
(
wszKey
+
sizeof
(
wszProtocolsKey
)
/
sizeof
(
WCHAR
),
schema
,
(
schema_len
+
1
)
*
sizeof
(
WCHAR
));
res
=
RegOpenKeyW
(
HKEY_CLASSES_ROOT
,
wszKey
,
&
hkey
);
HeapFree
(
GetProcessHeap
(),
0
,
wszKey
);
if
(
res
!=
ERROR_SUCCESS
)
{
TRACE
(
"Could not open key %s
\n
"
,
debugstr_w
(
wszKey
));
return
E_FAIL
;
}
size
=
sizeof
(
str_clsid
);
res
=
RegQueryValueExW
(
hkey
,
wszCLSID
,
NULL
,
&
type
,
(
LPBYTE
)
str_clsid
,
&
size
);
RegCloseKey
(
hkey
);
if
(
res
!=
ERROR_SUCCESS
||
type
!=
REG_SZ
)
{
WARN
(
"Could not get protocol CLSID res=%ld
\n
"
,
res
);
return
E_FAIL
;
}
hres
=
CLSIDFromString
(
str_clsid
,
&
clsid
);
if
(
FAILED
(
hres
))
{
WARN
(
"CLSIDFromString failed: %08lx
\n
"
,
hres
);
return
hres
;
}
return
CoGetClassObject
(
&
clsid
,
CLSCTX_INPROC_SERVER
,
NULL
,
&
IID_IUnknown
,
(
void
**
)
ret
);
}
static
HRESULT
WINAPI
InternetSession_QueryInterface
(
IInternetSession
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
...
...
dlls/urlmon/urlmon_main.h
View file @
9630d155
...
...
@@ -54,4 +54,6 @@ typedef struct
HRESULT
UMCreateStreamOnCacheFile
(
LPCWSTR
pszURL
,
DWORD
dwSize
,
LPWSTR
pszFileName
,
HANDLE
*
phfile
,
IUMCacheStream
**
ppstr
);
void
UMCloseCacheFileStream
(
IUMCacheStream
*
pstr
);
HRESULT
get_protocol_iface
(
LPCWSTR
url
,
IUnknown
**
ret
);
#endif
/* __WINE_URLMON_MAIN_H */
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