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
5d46c586
Commit
5d46c586
authored
Nov 12, 1999
by
Huw D M Davies
Committed by
Alexandre Julliard
Nov 12, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Comment out explicit call to SHELL_SaveRegistry since winelib programs
now exit properly. Change several NULLs to '\0's. Fix some spelling.
parent
b5fed2f0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
34 deletions
+32
-34
regapi.c
programs/regapi/regapi.c
+32
-34
No files found.
programs/regapi/regapi.c
View file @
5d46c586
...
...
@@ -38,13 +38,13 @@ static BOOL bForce = FALSE; /* Is set to TRUE when -force is
/* Globals used by the api setValue, queryValue */
static
LPSTR
currentKeyName
=
NULL
;
static
HKEY
currentKeyClass
=
NULL
;
static
HKEY
currentKeyHandle
=
NULL
;
static
HKEY
currentKeyClass
=
0
;
static
HKEY
currentKeyHandle
=
0
;
static
BOOL
bTheKeyIsOpen
=
FALSE
;
/* Delimit
o
rs used to parse the "value"="data" pair for setValue*/
/* Delimit
e
rs used to parse the "value"="data" pair for setValue*/
#define SET_VALUE_MAX_ARGS 2
/* Delimit
o
rs used to parse the "value" to query queryValue*/
/* Delimit
e
rs used to parse the "value" to query queryValue*/
#define QUERY_VALUE_MAX_ARGS 1
static
const
char
*
setValueDelim
[
SET_VALUE_MAX_ARGS
]
=
{
"="
,
""
};
...
...
@@ -99,7 +99,7 @@ static void doDeleteKey(LPSTR lpsLine);
static
void
doQueryValue
(
LPSTR
lpsLine
);
/*
* current su
u
ported api
* current su
p
ported api
*/
static
const
char
*
commandNames
[
COMMAND_COUNT
]
=
{
"setValue"
,
...
...
@@ -158,17 +158,17 @@ static HRESULT setValue(LPSTR *argv);
static
void
processQueryValue
(
LPSTR
cmdline
);
/*
* Help Text displyed when invalid parameters are provided
* Help Text displ
a
yed when invalid parameters are provided
*/
static
char
helpText
[]
=
"
NAME
regapi - provide a command line interface to the wine registry.
SYNOPS
Y
S
SYNOPS
I
S
regapi commandName [-force] < file
DESCRIPTION
regapi allows editing the wine re
s
gistry. It processes the given
regapi allows editing the wine registry. It processes the given
commandName for every line in the stdin data stream. Input data
format may vary depending on the commandName see INPUT FILE FORMAT.
...
...
@@ -185,7 +185,7 @@ OPTIONS
was previously set to another value.
< file
STDIN chanel, provide a file name with line of the appropriate
STDIN chan
n
el, provide a file name with line of the appropriate
format.
INPUT FILE FORMAT
...
...
@@ -217,7 +217,7 @@ INPUT FILE FORMAT
/******************************************************************************
* This funtion returns the HKEY associated with the data type encoded in the
* This fun
c
tion returns the HKEY associated with the data type encoded in the
* value. It modify the input parameter (key value) in order to skip this
* "now useless" data type information.
*/
...
...
@@ -261,7 +261,7 @@ LPSTR getRegKeyName(LPSTR lpLine)
keyNameBeg
=
strstr
(
lpLineCopy
,
"
\\
"
);
/* The key name start by '\' */
keyNameBeg
++
;
/* but is not part of the key name */
keyNameEnd
=
strstr
(
lpLineCopy
,
"]"
);
/* The key name end by ']' */
*
keyNameEnd
=
NULL
;
/* Isolate the key name */
*
keyNameEnd
=
'\0'
;
/* Isolate the key name */
currentKeyName
=
HeapAlloc
(
GetProcessHeap
(),
0
,
strlen
(
keyNameBeg
)
+
1
);
if
(
currentKeyName
!=
NULL
)
...
...
@@ -287,7 +287,7 @@ static HKEY getRegClass(LPSTR lpClass)
strcpy
(
lpClassCopy
,
lpClass
);
classNameEnd
=
strstr
(
lpClassCopy
,
"
\\
"
);
/* The class name end by '\' */
*
classNameEnd
=
NULL
;
/* Isolate the class name */
*
classNameEnd
=
'\0'
;
/* Isolate the class name */
classNameBeg
=
&
lpClassCopy
[
1
];
/* Skip the '[' */
if
(
strcmp
(
classNameBeg
,
"HKEY_LOCAL_MACHINE"
)
==
IDENTICAL
)
...
...
@@ -321,7 +321,7 @@ static LPSTR getArg( LPSTR arg)
*/
len
=
strlen
(
arg
);
if
(
arg
[
len
-
1
]
==
'\"'
)
arg
[
len
-
1
]
=
NULL
;
if
(
arg
[
len
-
1
]
==
'\"'
)
arg
[
len
-
1
]
=
'\0'
;
if
(
arg
[
0
]
==
'\"'
)
arg
++
;
tmp
=
HeapAlloc
(
GetProcessHeap
(),
0
,
strlen
(
arg
)
+
1
);
...
...
@@ -371,7 +371,7 @@ static DWORD convertHexToDWord(char *str, BYTE *buf)
}
/******************************************************************************
* Converts a hex buffer into a hex coma separated values
* Converts a hex buffer into a hex com
m
a separated values
*/
static
char
*
convertHexToHexCSV
(
BYTE
*
buf
,
ULONG
bufLen
)
{
...
...
@@ -396,8 +396,8 @@ static char* convertHexToHexCSV(BYTE *buf, ULONG bufLen)
strcat
(
str
,
","
);
}
/* Get rid of the last coma */
str
[
strlen
(
str
)
-
1
]
=
NULL
;
/* Get rid of the last com
m
a */
str
[
strlen
(
str
)
-
1
]
=
'\0'
;
return
str
;
}
...
...
@@ -426,11 +426,11 @@ static char* convertHexToDWORDStr(BYTE *buf, ULONG bufLen)
strcat
(
str
,
res
);
}
/* Get rid of the last coma */
/* Get rid of the last com
m
a */
return
str
;
}
/******************************************************************************
* Converts a hex coma separated values list into a hex list.
* Converts a hex com
m
a separated values list into a hex list.
*/
static
DWORD
convertHexCSVToHex
(
char
*
str
,
BYTE
*
buf
,
ULONG
bufLen
)
{
...
...
@@ -448,7 +448,7 @@ static DWORD convertHexCSVToHex(char *str, BYTE *buf, ULONG bufLen)
* not contains ",". It is more likely because the data is invalid.
*/
if
(
(
strlen
(
str
)
>
2
)
&&
(
strstr
(
str
,
","
)
==
NULL
)
)
printf
(
"regapi: WARNING converting CSV hex stream with no coma, "
printf
(
"regapi: WARNING converting CSV hex stream with no com
m
a, "
"input data seems invalid.
\n
"
);
while
(
strPos
<
strLen
)
...
...
@@ -477,7 +477,7 @@ static HRESULT setValue(LPSTR *argv)
{
HRESULT
hRes
;
DWORD
dwSize
=
KEY_MAX_LEN
;
DWORD
dwType
=
NULL
;
DWORD
dwType
=
0
;
DWORD
dwDataType
;
LPSTR
lpsCurrentValue
;
...
...
@@ -495,7 +495,7 @@ static HRESULT setValue(LPSTR *argv)
* blank in the wine registry.
*/
if
(
(
keyValue
[
0
]
==
'@'
)
&&
(
strlen
(
keyValue
)
==
1
)
)
keyValue
[
0
]
=
NULL
;
keyValue
[
0
]
=
'\0'
;
/* Get the data type stored into the value field */
dwDataType
=
getDataType
(
&
keyData
);
...
...
@@ -615,7 +615,7 @@ static void processSetValue(LPSTR cmdline)
LPSTR
token
=
NULL
;
/* current token analized */
ULONG
argCounter
=
0
;
/* counter of args */
INT
counter
;
HRESULT
hRes
=
NULL
;
HRESULT
hRes
=
0
;
/*
* Init storage and parse the line
...
...
@@ -670,7 +670,7 @@ static void processQueryValue(LPSTR cmdline)
LPSTR
token
=
NULL
;
/* current token analized */
ULONG
argCounter
=
0
;
/* counter of args */
INT
counter
;
HRESULT
hRes
=
NULL
;
HRESULT
hRes
=
0
;
LPSTR
keyValue
=
NULL
;
LPSTR
lpsRes
=
NULL
;
...
...
@@ -808,8 +808,8 @@ static void closeKey()
bTheKeyIsOpen
=
FALSE
;
currentKeyName
=
NULL
;
currentKeyClass
=
NULL
;
currentKeyHandle
=
NULL
;
currentKeyClass
=
0
;
currentKeyHandle
=
0
;
}
/******************************************************************************
...
...
@@ -984,18 +984,18 @@ int PASCAL WinMain (HANDLE inst, HANDLE prev, LPSTR cmdline, int show)
*/
if
(
stdInput
!=
NULL
)
{
stdInput
[
strlen
(
stdInput
)
-
1
]
=
NULL
;
/* get rid of new line */
stdInput
[
strlen
(
stdInput
)
-
1
]
=
'\0'
;
/* get rid of new line */
if
(
stdInput
[
0
]
==
'#'
)
/* this is a comment, skip */
continue
;
while
(
stdInput
[
strlen
(
stdInput
)
-
1
]
==
'\\'
){
/* a '\' char in the end of the current line means */
/* that this line is not complete and we have to get */
stdInput
[
strlen
(
stdInput
)
-
1
]
=
NULL
;
/* the rest in the next lines */
stdInput
[
strlen
(
stdInput
)
-
1
]
=
'\0'
;
/* the rest in the next lines */
nextLine
=
fgets
(
nextLine
,
STDIN_MAX_LEN
,
stdin
);
nextLine
[
strlen
(
nextLine
)
-
1
]
=
NULL
;
nextLine
[
strlen
(
nextLine
)
-
1
]
=
'\0'
;
if
(
(
strlen
(
stdInput
)
+
strlen
(
nextLine
))
>
currentSize
){
...
...
@@ -1018,18 +1018,16 @@ int PASCAL WinMain (HANDLE inst, HANDLE prev, LPSTR cmdline, int show)
break
;
}
#if 0
/*
* Save the registry only if it was modified
*/
if
(
commandSaveRegistry
[
cmdIndex
]
!=
FALSE
)
SHELL_SaveRegistry
();
if ( commandSaveRegistry[cmdIndex] != FALSE )
SHELL_SaveRegistry();
#endif
HeapFree
(
GetProcessHeap
(),
0
,
nextLine
);
HeapFree
(
GetProcessHeap
(),
0
,
stdInput
);
return
SUCCESS
;
}
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