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
f362a3f4
Commit
f362a3f4
authored
Mar 18, 2005
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 18, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Keys may have only one of attributes.
parent
e8a5c293
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
27 deletions
+40
-27
registrar.c
dlls/atl/registrar.c
+40
-27
No files found.
dlls/atl/registrar.c
View file @
f362a3f4
...
...
@@ -192,12 +192,19 @@ static HRESULT do_preprocess(Registrar *This, LPCOLESTR data, strbuf *buf)
static
HRESULT
do_process_key
(
LPCOLESTR
*
pstr
,
HKEY
parent_key
,
strbuf
*
buf
,
BOOL
do_register
)
{
LPCOLESTR
iter
=
*
pstr
;
BOOL
no_remove
=
FALSE
,
is_val
=
FALSE
,
force_remove
=
FALSE
,
do_delete
=
FALSE
;
HRESULT
hres
;
LONG
lres
;
HKEY
hkey
=
0
;
strbuf
name
;
enum
{
NORMAL
,
NO_REMOVE
,
IS_VAL
,
FORCE_REMOVE
,
DO_DELETE
}
key_type
=
NORMAL
;
static
const
WCHAR
wstrNoRemove
[]
=
{
'N'
,
'o'
,
'R'
,
'e'
,
'm'
,
'o'
,
'v'
,
'e'
,
0
};
static
const
WCHAR
wstrForceRemove
[]
=
{
'F'
,
'o'
,
'r'
,
'c'
,
'e'
,
'R'
,
'e'
,
'm'
,
'o'
,
'v'
,
'e'
,
0
};
static
const
WCHAR
wstrDelete
[]
=
{
'D'
,
'e'
,
'l'
,
'e'
,
't'
,
'e'
,
0
};
...
...
@@ -210,30 +217,32 @@ static HRESULT do_process_key(LPCOLESTR *pstr, HKEY parent_key, strbuf *buf, BOO
strbuf_init
(
&
name
);
while
(
buf
->
str
[
1
]
||
buf
->
str
[
0
]
!=
'}'
)
{
if
(
!
lstrcmpW
(
buf
->
str
,
wstrNoRemove
))
{
no_remove
=
TRUE
;
}
else
if
(
!
lstrcmpW
(
buf
->
str
,
wstrForceRemove
))
{
force_remove
=
TRUE
;
}
else
if
(
!
lstrcmpW
(
buf
->
str
,
wstrval
))
{
is_val
=
TRUE
;
}
else
if
(
!
lstrcmpW
(
buf
->
str
,
wstrDelete
))
{
do_delete
=
TRUE
;
}
else
{
TRACE
(
"name = %s
\n
"
,
debugstr_w
(
buf
->
str
));
if
(
do_register
)
{
if
(
is_val
)
{
if
(
force_remove
||
no_remove
||
do_delete
)
{
WARN
(
"Attribites for value!
\n
"
);
hres
=
DISP_E_EXCEPTION
;
key_type
=
NORMAL
;
if
(
!
lstrcmpW
(
buf
->
str
,
wstrNoRemove
))
key_type
=
NO_REMOVE
;
else
if
(
!
lstrcmpW
(
buf
->
str
,
wstrForceRemove
))
key_type
=
FORCE_REMOVE
;
else
if
(
!
lstrcmpW
(
buf
->
str
,
wstrval
))
key_type
=
IS_VAL
;
else
if
(
!
lstrcmpW
(
buf
->
str
,
wstrDelete
))
key_type
=
DO_DELETE
;
if
(
key_type
!=
NORMAL
)
{
hres
=
get_word
(
&
iter
,
buf
);
if
(
FAILED
(
hres
))
break
;
}
TRACE
(
"name = %s
\n
"
,
debugstr_w
(
buf
->
str
));
if
(
do_register
)
{
if
(
key_type
==
IS_VAL
)
{
hkey
=
parent_key
;
strbuf_write
(
buf
->
str
,
&
name
,
-
1
);
}
else
if
(
do_delete
)
{
}
else
if
(
key_type
==
DO_DELETE
)
{
TRACE
(
"Deleting %s
\n
"
,
debugstr_w
(
buf
->
str
));
lres
=
SHDeleteKeyW
(
parent_key
,
buf
->
str
);
}
else
{
if
(
force_remove
)
if
(
key_type
==
FORCE_REMOVE
)
SHDeleteKeyW
(
parent_key
,
buf
->
str
);
lres
=
RegCreateKeyW
(
parent_key
,
buf
->
str
,
&
hkey
);
if
(
lres
!=
ERROR_SUCCESS
)
{
...
...
@@ -242,13 +251,14 @@ static HRESULT do_process_key(LPCOLESTR *pstr, HKEY parent_key, strbuf *buf, BOO
break
;
}
}
}
else
if
(
!
is_val
&&
!
do_delete
)
{
}
else
if
(
key_type
!=
IS_VAL
&&
key_type
!=
DO_DELETE
)
{
strbuf_write
(
buf
->
str
,
&
name
,
-
1
);
lres
=
RegOpenKeyW
(
parent_key
,
buf
->
str
,
&
hkey
);
if
(
lres
!=
ERROR_SUCCESS
)
WARN
(
"Could not open key %s: %08lx
\n
"
,
debugstr_w
(
name
.
str
),
lres
);
}
if
(
!
do_delete
&&
*
iter
==
'='
)
{
if
(
key_type
!=
DO_DELETE
&&
*
iter
==
'='
)
{
iter
++
;
hres
=
get_word
(
&
iter
,
buf
);
if
(
FAILED
(
hres
))
...
...
@@ -302,12 +312,13 @@ static HRESULT do_process_key(LPCOLESTR *pstr, HKEY parent_key, strbuf *buf, BOO
if
(
FAILED
(
hres
))
break
;
}
}
else
if
(
is_val
)
{
}
else
if
(
key_type
==
IS_VAL
)
{
WARN
(
"value not set!
\n
"
);
hres
=
DISP_E_EXCEPTION
;
break
;
}
if
(
!
is_val
&&
!
do_delete
&&
*
iter
==
'{'
)
{
if
(
key_type
!=
IS_VAL
&&
key_type
!=
DO_DELETE
&&
*
iter
==
'{'
)
{
hres
=
get_word
(
&
iter
,
buf
);
if
(
FAILED
(
hres
))
break
;
...
...
@@ -315,23 +326,25 @@ static HRESULT do_process_key(LPCOLESTR *pstr, HKEY parent_key, strbuf *buf, BOO
if
(
FAILED
(
hres
))
break
;
}
if
(
!
do_register
&&
!
do_delete
&&
!
is_val
&&
!
no_remove
)
{
TRACE
(
"%x %x
\n
"
,
do_register
,
key_type
);
if
(
!
do_register
&&
(
key_type
==
NORMAL
||
key_type
==
FORCE_REMOVE
))
{
TRACE
(
"Deleting %s
\n
"
,
debugstr_w
(
name
.
str
));
RegDeleteKeyW
(
parent_key
,
name
.
str
);
}
if
(
hkey
&&
!
is_val
)
if
(
hkey
&&
key_type
!=
IS_VAL
)
RegCloseKey
(
hkey
);
hkey
=
0
;
name
.
len
=
0
;
no_remove
=
is_val
=
force_remove
=
do_delete
=
FALSE
;
}
hres
=
get_word
(
&
iter
,
buf
);
if
(
FAILED
(
hres
))
break
;
}
HeapFree
(
GetProcessHeap
(),
0
,
name
.
str
);
if
(
hkey
&&
!
is_val
)
if
(
hkey
&&
key_type
!=
IS_VAL
)
RegCloseKey
(
hkey
);
*
pstr
=
iter
;
return
hres
;
...
...
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