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
d2a221d2
Commit
d2a221d2
authored
Nov 24, 2010
by
Damjan Jovanovic
Committed by
Alexandre Julliard
Nov 24, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
atl: Improve IRegistrar dword parsing.
parent
10df3978
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
126 additions
and
9 deletions
+126
-9
registrar.c
dlls/atl/registrar.c
+4
-8
Makefile.in
dlls/atl/tests/Makefile.in
+2
-1
registrar.c
dlls/atl/tests/registrar.c
+120
-0
No files found.
dlls/atl/registrar.c
View file @
d2a221d2
...
...
@@ -285,15 +285,11 @@ static HRESULT do_process_key(LPCOLESTR *pstr, HKEY parent_key, strbuf *buf, BOO
}
break
;
case
'd'
:
{
WCHAR
*
end
;
DWORD
dw
;
if
(
*
iter
==
'0'
&&
iter
[
1
]
==
'x'
)
{
iter
+=
2
;
dw
=
strtolW
(
iter
,
&
end
,
16
);
}
else
{
dw
=
strtolW
(
iter
,
&
end
,
10
);
}
iter
=
end
;
hres
=
get_word
(
&
iter
,
buf
);
if
(
FAILED
(
hres
))
break
;
dw
=
atoiW
(
buf
->
str
);
lres
=
RegSetValueExW
(
hkey
,
name
.
len
?
name
.
str
:
NULL
,
0
,
REG_DWORD
,
(
PBYTE
)
&
dw
,
sizeof
(
dw
));
if
(
lres
!=
ERROR_SUCCESS
)
{
...
...
dlls/atl/tests/Makefile.in
View file @
d2a221d2
...
...
@@ -3,6 +3,7 @@ IMPORTS = uuid atl oleaut32 ole32 rpcrt4 user32 gdi32 advapi32
C_SRCS
=
\
atl_ax.c
\
module.c
module.c
\
registrar.c
@MAKE_TEST_RULES@
dlls/atl/tests/registrar.c
0 → 100644
View file @
d2a221d2
/*
* ATL test program
*
* Copyright 2010 Damjan Jovanovic
*
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdarg.h>
#include <stdio.h>
#define COBJMACROS
#include <wine/test.h>
#include <windef.h>
#include <winbase.h>
#include <winuser.h>
#include <wingdi.h>
#include <winnls.h>
#include <winerror.h>
#include <winnt.h>
#include <wtypes.h>
#include <olectl.h>
#include <ocidl.h>
#include <initguid.h>
#include <atliface.h>
static
const
char
textA
[]
=
"HKCR
\n
"
"{
\n
"
" ForceRemove eebf73c4-50fd-478f-bbcf-db212221227a
\n
"
" {
\n
"
" val 'string' = s 'string'
\n
"
" val 'dword_quoted_dec' = d '1'
\n
"
" val 'dword_unquoted_dec' = d 1
\n
"
" val 'dword_quoted_hex' = d '0xA'
\n
"
" val 'dword_unquoted_hex' = d 0xA
\n
"
" }
\n
"
"}"
;
static
void
test_registrar
(
void
)
{
IRegistrar
*
registrar
=
NULL
;
HRESULT
hr
;
INT
count
;
WCHAR
*
textW
=
NULL
;
hr
=
CoCreateInstance
(
&
CLSID_Registrar
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IRegistrar
,
(
void
**
)
&
registrar
);
if
(
FAILED
(
hr
))
{
skip
(
"creating IRegistrar failed, hr = 0x%08X
\n
"
,
hr
);
return
;
}
count
=
MultiByteToWideChar
(
CP_ACP
,
0
,
textA
,
-
1
,
NULL
,
0
);
textW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
count
*
sizeof
(
WCHAR
));
if
(
textW
)
{
DWORD
dword
;
DWORD
size
;
LONG
lret
;
HKEY
key
;
MultiByteToWideChar
(
CP_ACP
,
0
,
textA
,
-
1
,
textW
,
count
);
hr
=
IRegistrar_StringRegister
(
registrar
,
textW
);
ok
(
SUCCEEDED
(
hr
),
"IRegistar_StringRegister failed, hr = 0x%08X
\n
"
,
hr
);
lret
=
RegOpenKeyA
(
HKEY_CLASSES_ROOT
,
"eebf73c4-50fd-478f-bbcf-db212221227a"
,
&
key
);
ok
(
lret
==
ERROR_SUCCESS
,
"error %d opening registry key
\n
"
,
lret
);
size
=
sizeof
(
dword
);
lret
=
RegQueryValueExA
(
key
,
"dword_unquoted_hex"
,
NULL
,
NULL
,
(
BYTE
*
)
&
dword
,
&
size
);
ok
(
lret
==
ERROR_SUCCESS
,
"RegQueryValueExA failed, error %d
\n
"
,
lret
);
ok
(
dword
!=
0xA
,
"unquoted hex is not supposed to be preserved
\n
"
);
size
=
sizeof
(
dword
);
lret
=
RegQueryValueExA
(
key
,
"dword_quoted_hex"
,
NULL
,
NULL
,
(
BYTE
*
)
&
dword
,
&
size
);
ok
(
lret
==
ERROR_SUCCESS
,
"RegQueryValueExA failed, error %d
\n
"
,
lret
);
ok
(
dword
!=
0xA
,
"quoted hex is not supposed to be preserved
\n
"
);
size
=
sizeof
(
dword
);
lret
=
RegQueryValueExA
(
key
,
"dword_unquoted_dec"
,
NULL
,
NULL
,
(
BYTE
*
)
&
dword
,
&
size
);
ok
(
lret
==
ERROR_SUCCESS
,
"RegQueryValueExA failed, error %d
\n
"
,
lret
);
ok
(
dword
==
1
,
"unquoted dec is not supposed to be %d
\n
"
,
dword
);
size
=
sizeof
(
dword
);
lret
=
RegQueryValueExA
(
key
,
"dword_quoted_dec"
,
NULL
,
NULL
,
(
BYTE
*
)
&
dword
,
&
size
);
ok
(
lret
==
ERROR_SUCCESS
,
"RegQueryValueExA failed, error %d
\n
"
,
lret
);
ok
(
dword
==
1
,
"quoted dec is not supposed to be %d
\n
"
,
dword
);
hr
=
IRegistrar_StringUnregister
(
registrar
,
textW
);
ok
(
SUCCEEDED
(
hr
),
"IRegistar_StringUnregister failed, hr = 0x%08X
\n
"
,
hr
);
RegCloseKey
(
key
);
}
else
skip
(
"allocating memory failed
\n
"
);
IRegistrar_Release
(
registrar
);
}
START_TEST
(
registrar
)
{
CoInitialize
(
NULL
);
test_registrar
();
CoUninitialize
();
}
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