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
070d9f91
Commit
070d9f91
authored
Jul 01, 2009
by
Andrew Nguyen
Committed by
Alexandre Julliard
Jul 01, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reg: Correct the sense of return values for registry operations.
parent
726891ad
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
18 deletions
+18
-18
reg.c
programs/reg/reg.c
+18
-18
No files found.
programs/reg/reg.c
View file @
070d9f91
...
...
@@ -147,14 +147,14 @@ static int reg_add(WCHAR *key_name, WCHAR *value_name, BOOL value_empty,
if
(
key_name
[
0
]
==
'\\'
&&
key_name
[
1
]
==
'\\'
)
{
reg_message
(
STRING_NO_REMOTE
);
return
0
;
return
1
;
}
p
=
strchrW
(
key_name
,
'\\'
);
if
(
!
p
)
{
reg_message
(
STRING_INVALID_KEY
);
return
0
;
return
1
;
}
p
++
;
...
...
@@ -162,13 +162,13 @@ static int reg_add(WCHAR *key_name, WCHAR *value_name, BOOL value_empty,
if
(
!
root
)
{
reg_message
(
STRING_INVALID_KEY
);
return
0
;
return
1
;
}
if
(
RegCreateKeyW
(
root
,
p
,
&
subkey
)
!=
ERROR_SUCCESS
)
{
reg_message
(
STRING_INVALID_KEY
);
return
0
;
return
1
;
}
if
(
value_name
||
data
)
...
...
@@ -190,7 +190,7 @@ static int reg_add(WCHAR *key_name, WCHAR *value_name, BOOL value_empty,
{
RegCloseKey
(
subkey
);
reg_message
(
STRING_INVALID_CMDLINE
);
return
0
;
return
1
;
}
if
(
data
)
...
...
@@ -203,7 +203,7 @@ static int reg_add(WCHAR *key_name, WCHAR *value_name, BOOL value_empty,
RegCloseKey
(
subkey
);
reg_message
(
STRING_SUCCESS
);
return
1
;
return
0
;
}
static
int
reg_delete
(
WCHAR
*
key_name
,
WCHAR
*
value_name
,
BOOL
value_empty
,
...
...
@@ -220,14 +220,14 @@ static int reg_delete(WCHAR *key_name, WCHAR *value_name, BOOL value_empty,
if
(
key_name
[
0
]
==
'\\'
&&
key_name
[
1
]
==
'\\'
)
{
reg_message
(
STRING_NO_REMOTE
);
return
0
;
return
1
;
}
p
=
strchrW
(
key_name
,
'\\'
);
if
(
!
p
)
{
reg_message
(
STRING_INVALID_KEY
);
return
0
;
return
1
;
}
p
++
;
...
...
@@ -235,19 +235,19 @@ static int reg_delete(WCHAR *key_name, WCHAR *value_name, BOOL value_empty,
if
(
!
root
)
{
reg_message
(
STRING_INVALID_KEY
);
return
0
;
return
1
;
}
if
(
value_name
&&
value_empty
)
{
reg_message
(
STRING_INVALID_CMDLINE
);
return
0
;
return
1
;
}
if
(
value_empty
&&
value_all
)
{
reg_message
(
STRING_INVALID_CMDLINE
);
return
0
;
return
1
;
}
if
(
!
force
)
...
...
@@ -260,16 +260,16 @@ static int reg_delete(WCHAR *key_name, WCHAR *value_name, BOOL value_empty,
if
(
RegDeleteTreeW
(
root
,
p
)
!=
ERROR_SUCCESS
)
{
reg_message
(
STRING_CANNOT_FIND
);
return
0
;
return
1
;
}
reg_message
(
STRING_SUCCESS
);
return
1
;
return
0
;
}
if
(
RegOpenKeyW
(
root
,
p
,
&
subkey
)
!=
ERROR_SUCCESS
)
{
reg_message
(
STRING_CANNOT_FIND
);
return
0
;
return
1
;
}
if
(
value_all
)
...
...
@@ -283,7 +283,7 @@ static int reg_delete(WCHAR *key_name, WCHAR *value_name, BOOL value_empty,
{
RegCloseKey
(
subkey
);
reg_message
(
STRING_INVALID_CMDLINE
);
return
0
;
return
1
;
}
rc
=
RegQueryInfoKeyW
(
subkey
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
...
...
@@ -292,7 +292,7 @@ static int reg_delete(WCHAR *key_name, WCHAR *value_name, BOOL value_empty,
{
/* FIXME: failure */
RegCloseKey
(
subkey
);
return
0
;
return
1
;
}
maxValue
++
;
szValue
=
HeapAlloc
(
GetProcessHeap
(),
0
,
maxValue
*
sizeof
(
WCHAR
));
...
...
@@ -320,7 +320,7 @@ static int reg_delete(WCHAR *key_name, WCHAR *value_name, BOOL value_empty,
{
RegCloseKey
(
subkey
);
reg_message
(
STRING_CANNOT_FIND
);
return
0
;
return
1
;
}
}
else
if
(
value_empty
)
...
...
@@ -330,7 +330,7 @@ static int reg_delete(WCHAR *key_name, WCHAR *value_name, BOOL value_empty,
RegCloseKey
(
subkey
);
reg_message
(
STRING_SUCCESS
);
return
1
;
return
0
;
}
static
int
reg_query
(
WCHAR
*
key_name
,
WCHAR
*
value_name
,
BOOL
value_empty
,
...
...
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