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
c4cd0bf6
Commit
c4cd0bf6
authored
May 08, 1999
by
Noomen Hamza
Committed by
Alexandre Julliard
May 08, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug fixes.
parent
115d8cca
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
73 additions
and
50 deletions
+73
-50
winreg.h
include/winreg.h
+1
-12
registry.c
misc/registry.c
+2
-20
regapi.c
programs/regapi/regapi.c
+70
-18
No files found.
include/winreg.h
View file @
c4cd0bf6
...
...
@@ -31,18 +31,7 @@
#define REG_MULTI_SZ 7
/* multiple strings, delimited by \0, terminated by \0\0 (ASCII) */
#define REG_RESOURCE_LIST 8
/* resource list? huh? */
#define REG_FULL_RESOURCE_DESCRIPTOR 9
/* full resource descriptor? huh? */
#define HEX_REG_NONE 0x80000000
#define HEX_REG_SZ 0x80000001
#define HEX_REG_EXPAND_SZ 0x80000002
#define HEX_REG_BINARY 0x80000003
#define HEX_REG_DWORD 0x80000004
#define HEX_REG_DWORD_LITTLE_ENDIAN 0x80000004
#define HEX_REG_DWORD_BIG_ENDIAN 0x80000005
#define HEX_REG_LINK 0x80000006
#define HEX_REG_MULTI_SZ 0x80000007
#define HEX_REG_RESOURCE_LIST 0x80000008
#define HEX_REG_FULL_RESOURCE_DESCRIPTOR 0x80000009
#define REG_RESOURCE_REQUIREMENTS_LIST 10
#define HKEY_CLASSES_ROOT ((HKEY) 0x80000000)
#define HKEY_CURRENT_USER ((HKEY) 0x80000001)
...
...
misc/registry.c
View file @
c4cd0bf6
...
...
@@ -183,22 +183,19 @@ static void debug_print_value (LPBYTE lpbData, LPKEYVALUE key)
{
switch
(
key
->
type
)
{
case
HEX_REG_EXPAND_SZ
:
case
HEX_REG_SZ
:
case
REG_EXPAND_SZ
:
case
REG_SZ
:
TRACE_
(
reg
)(
" Value %s, Data(sz)=%s
\n
"
,
debugstr_w
(
key
->
name
),
debugstr_w
((
LPCWSTR
)
lpbData
));
break
;
case
HEX_REG_DWORD
:
case
REG_DWORD
:
TRACE_
(
reg
)(
" Value %s, Data(dword)=0x%08lx
\n
"
,
debugstr_w
(
key
->
name
),
(
DWORD
)
*
lpbData
);
break
;
case
HEX_REG_MULTI_SZ
:
case
REG_MULTI_SZ
:
{
int
i
;
...
...
@@ -215,16 +212,7 @@ static void debug_print_value (LPBYTE lpbData, LPKEYVALUE key)
}
break
;
case
HEX_REG_NONE
:
case
HEX_REG_BINARY
:
case
HEX_REG_LINK
:
case
HEX_REG_RESOURCE_LIST
:
case
HEX_REG_FULL_RESOURCE_DESCRIPTOR
:
case
REG_NONE
:
case
REG_LINK
:
case
REG_RESOURCE_LIST
:
case
REG_FULL_RESOURCE_DESCRIPTOR
:
case
REG_BINARY
:
default:
{
char
szTemp
[
100
];
/* 3*32 + 3 + 1 */
int
i
;
...
...
@@ -241,12 +229,6 @@ static void debug_print_value (LPBYTE lpbData, LPKEYVALUE key)
debugstr_w
(
key
->
name
),
szTemp
);
}
break
;
default:
FIXME_
(
reg
)(
" Value %s, Unknown data type %ld
\n
"
,
debugstr_w
(
key
->
name
),
key
->
type
);
}
/* switch */
}
/* if */
}
...
...
programs/regapi/regapi.c
View file @
c4cd0bf6
...
...
@@ -71,18 +71,18 @@ static const dataTypeMap typeMap[] =
{
"hex(7):"
,
REG_MULTI_SZ
},
{
"hex(8):"
,
REG_RESOURCE_LIST
},
{
"hex(9):"
,
REG_FULL_RESOURCE_DESCRIPTOR
},
{
"hex(
80000000):"
,
REG_NONE
},
{
"hex(8000000
1):"
,
REG_SZ
},
{
"hex(8000000
2):"
,
REG_EXPAND_SZ
},
{
"hex(8000000
3):"
,
REG_BINARY
},
{
"hex(8000000
4):"
,
REG_DWORD
},
{
"hex(8000000
5):"
,
REG_DWORD_BIG_ENDIAN
},
{
"hex(8000000
6):"
,
REG_LINK
},
{
"hex(8000000
7):"
,
REG_MULTI_SZ
},
{
"hex(8000000
8):"
,
REG_RESOURCE_LIST
},
{
"hex(8000000
9):"
,
REG_FULL_RESOURCE_DESCRIPTOR
},
{
"hex(8000000
a):"
,
REG_BINARY
},
/* REG_RESOURCE_REQUIREMENTS_LIST}, !Exist */
{
"hex(8000000
A):"
,
REG_BINARY
},
/* REG_RESOURCE_REQUIREMENTS_LIST}, !Exist */
{
"hex(
10):"
,
REG_RESOURCE_REQUIREMENTS_LIST
},
{
"hex(8000000
0):"
,
0x80000000
},
{
"hex(8000000
1):"
,
0x80000001
},
{
"hex(8000000
2):"
,
0x80000002
},
{
"hex(8000000
3):"
,
0x80000003
},
{
"hex(8000000
4):"
,
0x80000004
},
{
"hex(8000000
5):"
,
0x80000005
},
{
"hex(8000000
6):"
,
0x80000006
},
{
"hex(8000000
7):"
,
0x80000007
},
{
"hex(8000000
8):"
,
0x80000008
},
{
"hex(8000000
9):"
,
0x80000000
},
{
"hex(8000000
a):"
,
0x8000000A
}
};
const
static
int
LAST_TYPE_MAP
=
sizeof
(
typeMap
)
/
sizeof
(
dataTypeMap
);
...
...
@@ -229,7 +229,7 @@ HKEY getDataType(LPSTR *lpValue)
for
(;
counter
<
LAST_TYPE_MAP
;
counter
++
)
{
LONG
len
=
strlen
(
typeMap
[
counter
].
mask
);
if
(
strncmp
(
*
lpValue
,
typeMap
[
counter
].
mask
,
len
)
==
IDENTICAL
)
if
(
strncmp
i
(
*
lpValue
,
typeMap
[
counter
].
mask
,
len
)
==
IDENTICAL
)
{
/*
* We found it, modify the value's pointer in order to skip the data
...
...
@@ -480,7 +480,7 @@ static HRESULT setValue(LPSTR *argv)
DWORD
dwType
=
NULL
;
DWORD
dwDataType
;
CHAR
lpsCurrentValue
[
KEY_MAX_LEN
]
;
LPSTR
lpsCurrentValue
;
LPSTR
keyValue
=
argv
[
0
];
LPSTR
keyData
=
argv
[
1
];
...
...
@@ -489,6 +489,7 @@ static HRESULT setValue(LPSTR *argv)
if
(
(
keyValue
==
NULL
)
||
(
keyData
==
NULL
)
)
return
ERROR_INVALID_PARAMETER
;
lpsCurrentValue
=
HeapAlloc
(
GetProcessHeap
(),
0
,
KEY_MAX_LEN
);
/*
* Default registry values are encoded in the input stream as '@' but as
* blank in the wine registry.
...
...
@@ -508,6 +509,12 @@ static HRESULT setValue(LPSTR *argv)
(
LPBYTE
)
lpsCurrentValue
,
&
dwSize
);
while
(
hRes
==
ERROR_MORE_DATA
){
dwSize
+=
KEY_MAX_LEN
;
lpsCurrentValue
=
HeapReAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
lpsCurrentValue
,
dwSize
);
hRes
=
RegQueryValueExA
(
currentKeyHandle
,
keyValue
,
NULL
,
&
dwType
,(
LPBYTE
)
lpsCurrentValue
,
&
dwSize
);
}
if
(
(
strlen
(
lpsCurrentValue
)
==
0
)
||
/* The value is not existing */
(
bForce
))
/* -force option */
{
...
...
@@ -690,7 +697,7 @@ static void processQueryValue(LPSTR cmdline)
if
(
(
keyValue
[
0
]
==
'@'
)
&&
(
strlen
(
keyValue
)
==
1
)
)
{
LONG
lLen
=
KEY_MAX_LEN
;
CHAR
lpsData
[
KEY_MAX_LEN
]
;
CHAR
*
lpsData
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
KEY_MAX_LEN
)
;
/*
* We need to query the key default value
*/
...
...
@@ -700,6 +707,12 @@ static void processQueryValue(LPSTR cmdline)
(
LPBYTE
)
lpsData
,
&
lLen
);
while
(
hRes
==
ERROR_MORE_DATA
){
lLen
+=
KEY_MAX_LEN
;
lpsData
=
HeapReAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
lpsData
,
lLen
);
hRes
=
RegQueryValue
(
currentKeyHandle
,
currentKeyName
,(
LPBYTE
)
lpsData
,
&
lLen
);
}
if
(
hRes
==
ERROR_SUCCESS
)
{
lpsRes
=
HeapAlloc
(
GetProcessHeap
(),
0
,
lLen
);
...
...
@@ -709,7 +722,7 @@ static void processQueryValue(LPSTR cmdline)
else
{
DWORD
dwLen
=
KEY_MAX_LEN
;
BYTE
lpbData
[
KEY_MAX_LEN
]
;
BYTE
*
lpbData
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
KEY_MAX_LEN
)
;
DWORD
dwType
;
/*
* We need to query a specific value for the key
...
...
@@ -722,6 +735,12 @@ static void processQueryValue(LPSTR cmdline)
(
LPBYTE
)
lpbData
,
&
dwLen
);
while
(
hRes
==
ERROR_MORE_DATA
){
dwLen
+=
KEY_MAX_LEN
;
lpbData
=
HeapReAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
lpbData
,
dwLen
);
hRes
=
RegQueryValueEx
(
currentKeyHandle
,
keyValue
,
NULL
,
&
dwType
,(
LPBYTE
)
lpbData
,
&
dwLen
);
}
if
(
hRes
==
ERROR_SUCCESS
)
{
/*
...
...
@@ -730,6 +749,7 @@ static void processQueryValue(LPSTR cmdline)
switch
(
dwType
)
{
case
REG_SZ
:
case
REG_EXPAND_SZ
:
{
lpsRes
=
HeapAlloc
(
GetProcessHeap
(),
0
,
dwLen
);
strncpy
(
lpsRes
,
lpbData
,
dwLen
);
...
...
@@ -747,6 +767,8 @@ static void processQueryValue(LPSTR cmdline)
}
}
}
HeapFree
(
GetProcessHeap
(),
0
,
lpbData
);
}
...
...
@@ -904,9 +926,13 @@ int PASCAL WinMain (HANDLE inst, HANDLE prev, LPSTR cmdline, int show)
LPSTR
token
=
NULL
;
/* current token analized */
LPSTR
stdInput
=
NULL
;
/* line read from stdin */
INT
cmdIndex
=
-
1
;
/* index of the command in array */
LPSTR
nextLine
=
NULL
;
ULONG
currentSize
=
STDIN_MAX_LEN
;
stdInput
=
HeapAlloc
(
GetProcessHeap
(),
0
,
STDIN_MAX_LEN
);
if
(
stdInput
==
NULL
)
nextLine
=
HeapAlloc
(
GetProcessHeap
(),
0
,
STDIN_MAX_LEN
);
if
(
stdInput
==
NULL
||
nextLine
==
NULL
)
return
NOT_ENOUGH_MEMORY
;
/*
...
...
@@ -946,8 +972,13 @@ int PASCAL WinMain (HANDLE inst, HANDLE prev, LPSTR cmdline, int show)
/*
* read a line
*/
stdInput
=
fgets
(
stdInput
,
STDIN_MAX_LEN
,
stdin
);
ULONG
curSize
=
STDIN_MAX_LEN
;
char
*
s
=
NULL
;
while
((
NULL
!=
(
stdInput
=
fgets
(
stdInput
,
curSize
,
stdin
)))
&&
(
NULL
==
(
s
=
strchr
(
stdInput
,
'\n'
)))
){
fseek
(
stdin
,
-
curSize
,
SEEK_CUR
+
1
);
stdInput
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
stdInput
,
curSize
+=
STDIN_MAX_LEN
);
}
/*
* Make some handy generic stuff here...
*/
...
...
@@ -957,6 +988,24 @@ int PASCAL WinMain (HANDLE inst, HANDLE prev, LPSTR cmdline, int show)
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 */
nextLine
=
fgets
(
nextLine
,
STDIN_MAX_LEN
,
stdin
);
nextLine
[
strlen
(
nextLine
)
-
1
]
=
NULL
;
if
(
(
strlen
(
stdInput
)
+
strlen
(
nextLine
))
>
currentSize
){
stdInput
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
stdInput
,
strlen
(
stdInput
)
+
STDIN_MAX_LEN
);
currentSize
+=
STDIN_MAX_LEN
;
}
strcat
(
stdInput
,
nextLine
+
2
);
}
}
/*
...
...
@@ -975,7 +1024,10 @@ int PASCAL WinMain (HANDLE inst, HANDLE prev, LPSTR cmdline, int show)
if
(
commandSaveRegistry
[
cmdIndex
]
!=
FALSE
)
SHELL_SaveRegistry
();
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