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
ec26cd27
Commit
ec26cd27
authored
Jul 16, 2006
by
Jacek Caban
Committed by
Alexandre Julliard
Jul 17, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon: Added UrlMkGetSessionOption implementation.
parent
91987152
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
96 additions
and
11 deletions
+96
-11
session.c
dlls/urlmon/session.c
+55
-0
misc.c
dlls/urlmon/tests/misc.c
+41
-0
urlmon_main.c
dlls/urlmon/urlmon_main.c
+0
-11
No files found.
dlls/urlmon/session.c
View file @
ec26cd27
...
...
@@ -323,3 +323,58 @@ HRESULT WINAPI CoInternetGetSession(DWORD dwSessionMode, IInternetSession **ppII
*
ppIInternetSession
=
&
InternetSession
;
return
S_OK
;
}
/**************************************************************************
* UrlMkGetSessionOption (URLMON.@)
*/
static
BOOL
get_url_encoding
(
HKEY
root
,
DWORD
*
encoding
)
{
DWORD
size
=
sizeof
(
DWORD
),
res
,
type
;
HKEY
hkey
;
static
const
WCHAR
wszKeyName
[]
=
{
'S'
,
'O'
,
'F'
,
'T'
,
'W'
,
'A'
,
'R'
,
'E'
,
'\\'
,
'M'
,
'i'
,
'c'
,
'r'
,
'o'
,
's'
,
'o'
,
'f'
,
't'
,
'\\'
,
'W'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
'\\'
,
'C'
,
'u'
,
'r'
,
'r'
,
'e'
,
'n'
,
't'
,
'V'
,
'e'
,
'r'
,
's'
,
'i'
,
'o'
,
'n'
,
'\\'
,
'I'
,
'n'
,
't'
,
'e'
,
'r'
,
'n'
,
'e'
,
't'
,
' '
,
'S'
,
'e'
,
't'
,
't'
,
'i'
,
'n'
,
'g'
,
's'
,
0
};
static
const
WCHAR
wszUrlEncoding
[]
=
{
'U'
,
'r'
,
'l'
,
'E'
,
'n'
,
'c'
,
'o'
,
'd'
,
'i'
,
'n'
,
'g'
,
0
};
res
=
RegOpenKeyW
(
root
,
wszKeyName
,
&
hkey
);
if
(
res
!=
ERROR_SUCCESS
)
return
FALSE
;
res
=
RegQueryValueExW
(
hkey
,
wszUrlEncoding
,
NULL
,
&
type
,
(
LPBYTE
)
encoding
,
&
size
);
RegCloseKey
(
hkey
);
return
res
==
ERROR_SUCCESS
;
}
HRESULT
WINAPI
UrlMkGetSessionOption
(
DWORD
dwOption
,
LPVOID
pBuffer
,
DWORD
dwBufferLength
,
DWORD
*
pdwBufferLength
,
DWORD
dwReserved
)
{
TRACE
(
"(%lx, %p, %ld, %p)
\n
"
,
dwOption
,
pBuffer
,
dwBufferLength
,
pdwBufferLength
);
if
(
dwReserved
)
WARN
(
"dwReserved = %ld
\n
"
,
dwReserved
);
switch
(
dwOption
)
{
case
URLMON_OPTION_URL_ENCODING
:
{
DWORD
encoding
=
0
;
if
(
!
pBuffer
||
dwBufferLength
<
sizeof
(
DWORD
)
||
!
pdwBufferLength
)
return
E_INVALIDARG
;
if
(
!
get_url_encoding
(
HKEY_CURRENT_USER
,
&
encoding
))
get_url_encoding
(
HKEY_LOCAL_MACHINE
,
&
encoding
);
*
pdwBufferLength
=
sizeof
(
DWORD
);
*
(
DWORD
*
)
pBuffer
=
encoding
?
URL_ENCODING_DISABLE_UTF8
:
URL_ENCODING_ENABLE_UTF8
;
return
S_OK
;
}
default:
FIXME
(
"unsupported option %lx
\n
"
,
dwOption
);
}
return
E_INVALIDARG
;
}
dlls/urlmon/tests/misc.c
View file @
ec26cd27
...
...
@@ -953,6 +953,46 @@ static void test_ReleaseBindInfo(void)
ok
(
bi
.
pUnk
==
&
unk
,
"bi.pUnk=%p, expected %p
\n
"
,
bi
.
pUnk
,
&
unk
);
}
static
void
test_UrlMkGetSessionOption
(
void
)
{
DWORD
encoding
,
size
;
HRESULT
hres
;
size
=
encoding
=
0xdeadbeef
;
hres
=
UrlMkGetSessionOption
(
URLMON_OPTION_URL_ENCODING
,
&
encoding
,
sizeof
(
encoding
),
&
size
,
0
);
ok
(
hres
==
S_OK
,
"UrlMkGetSessionOption failed: %08lx
\n
"
,
hres
);
ok
(
encoding
!=
0xdeadbeef
,
"encoding not changed
\n
"
);
ok
(
size
==
sizeof
(
encoding
),
"size=%ld
\n
"
,
size
);
size
=
encoding
=
0xdeadbeef
;
hres
=
UrlMkGetSessionOption
(
URLMON_OPTION_URL_ENCODING
,
&
encoding
,
sizeof
(
encoding
)
+
1
,
&
size
,
0
);
ok
(
hres
==
S_OK
,
"UrlMkGetSessionOption failed: %08lx
\n
"
,
hres
);
ok
(
encoding
!=
0xdeadbeef
,
"encoding not changed
\n
"
);
ok
(
size
==
sizeof
(
encoding
),
"size=%ld
\n
"
,
size
);
size
=
encoding
=
0xdeadbeef
;
hres
=
UrlMkGetSessionOption
(
URLMON_OPTION_URL_ENCODING
,
&
encoding
,
sizeof
(
encoding
)
-
1
,
&
size
,
0
);
ok
(
hres
==
E_INVALIDARG
,
"UrlMkGetSessionOption failed: %08lx
\n
"
,
hres
);
ok
(
encoding
==
0xdeadbeef
,
"encoding = %08lx, exepcted 0xdeadbeef
\n
"
,
encoding
);
ok
(
size
==
0xdeadbeef
,
"size=%ld
\n
"
,
size
);
size
=
encoding
=
0xdeadbeef
;
hres
=
UrlMkGetSessionOption
(
URLMON_OPTION_URL_ENCODING
,
NULL
,
sizeof
(
encoding
)
-
1
,
&
size
,
0
);
ok
(
hres
==
E_INVALIDARG
,
"UrlMkGetSessionOption failed: %08lx
\n
"
,
hres
);
ok
(
encoding
==
0xdeadbeef
,
"encoding = %08lx, exepcted 0xdeadbeef
\n
"
,
encoding
);
ok
(
size
==
0xdeadbeef
,
"size=%ld
\n
"
,
size
);
encoding
=
0xdeadbeef
;
hres
=
UrlMkGetSessionOption
(
URLMON_OPTION_URL_ENCODING
,
&
encoding
,
sizeof
(
encoding
)
-
1
,
NULL
,
0
);
ok
(
hres
==
E_INVALIDARG
,
"UrlMkGetSessionOption failed: %08lx
\n
"
,
hres
);
ok
(
encoding
==
0xdeadbeef
,
"encoding = %08lx, exepcted 0xdeadbeef
\n
"
,
encoding
);
}
START_TEST
(
misc
)
{
OleInitialize
(
NULL
);
...
...
@@ -967,6 +1007,7 @@ START_TEST(misc)
test_ZoneManager
();
test_NameSpace
();
test_ReleaseBindInfo
();
test_UrlMkGetSessionOption
();
OleUninitialize
();
}
dlls/urlmon/urlmon_main.c
View file @
ec26cd27
...
...
@@ -283,17 +283,6 @@ HRESULT WINAPI UrlMkSetSessionOption(DWORD dwOption, LPVOID pBuffer, DWORD dwBuf
return
S_OK
;
}
/**************************************************************************
* UrlMkGetSessionOption (URLMON.@)
*/
HRESULT
WINAPI
UrlMkGetSessionOption
(
DWORD
dwOption
,
LPVOID
pBuffer
,
DWORD
dwBufferLength
,
DWORD
*
pdwBufferLength
,
DWORD
dwReserved
)
{
FIXME
(
"(%#lx, %p, %#lx, %p): stub
\n
"
,
dwOption
,
pBuffer
,
dwBufferLength
,
pdwBufferLength
);
return
S_OK
;
}
static
const
CHAR
Agent
[]
=
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"
;
/**************************************************************************
...
...
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