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
5b5d04dc
Commit
5b5d04dc
authored
Apr 04, 2000
by
Gavriel State
Committed by
Alexandre Julliard
Apr 04, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
This patch adds the ability for regapi to call the DllRegisterServer or
DllUnregisterServer for a list of DLLs.
parent
6edc9517
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
83 additions
and
4 deletions
+83
-4
regapi.c
programs/regapi/regapi.c
+83
-4
No files found.
programs/regapi/regapi.c
View file @
5b5d04dc
...
...
@@ -20,7 +20,7 @@
* Defines and consts
*/
#define IDENTICAL 0
#define COMMAND_COUNT
5
#define COMMAND_COUNT
7
#define KEY_MAX_LEN 1024
#define STDIN_MAX_LEN 2048
...
...
@@ -97,6 +97,8 @@ static void doDeleteValue(LPSTR lpsLine);
static
void
doCreateKey
(
LPSTR
lpsLine
);
static
void
doDeleteKey
(
LPSTR
lpsLine
);
static
void
doQueryValue
(
LPSTR
lpsLine
);
static
void
doRegisterDLL
(
LPSTR
lpsLine
);
static
void
doUnregisterDLL
(
LPSTR
lpsLine
);
/*
* current supported api
...
...
@@ -106,7 +108,9 @@ static const char* commandNames[COMMAND_COUNT] = {
"deleteValue"
,
"createKey"
,
"deleteKey"
,
"queryValue"
"queryValue"
,
"registerDLL"
,
"unregisterDLL"
};
/*
...
...
@@ -117,7 +121,9 @@ static const commandAPI commandAPIs[COMMAND_COUNT] = {
doDeleteValue
,
doCreateKey
,
doDeleteKey
,
doQueryValue
doQueryValue
,
doRegisterDLL
,
doUnregisterDLL
};
/*
...
...
@@ -128,7 +134,9 @@ static const BOOL commandSaveRegistry[COMMAND_COUNT] = {
TRUE
,
TRUE
,
TRUE
,
FALSE
FALSE
,
TRUE
,
TRUE
};
/*
...
...
@@ -212,6 +220,11 @@ static char helpText[] =
"
\"
Value2
\"\n
"
"
\"
Valuen
\"\n
"
" ...
\n
"
" registerDLL
\n
"
" The input file format is a list of DLLs to register
\n
"
"
\n
"
" unregisterDLL
\n
"
" The input file format is a list of DLLs to unregister
\n
"
" February 1999.
\n
"
;
...
...
@@ -919,6 +932,72 @@ static void doCreateKey(LPSTR line) {
}
/******************************************************************************
* This funtion is the main entry point to the registerDLL action. It
* receives the currently read line, then loads and registers the requested DLLs
*/
static
void
doRegisterDLL
(
LPSTR
stdInput
)
{
HMODULE
theLib
=
0
;
UINT
retVal
=
0
;
/* Check for valid input */
if
(
stdInput
==
NULL
)
return
;
/* Load and register the library, then free it */
theLib
=
LoadLibrary
(
stdInput
);
if
(
theLib
)
{
FARPROC
lpfnDLLRegProc
=
GetProcAddress
(
theLib
,
"DllRegisterServer"
);
if
(
lpfnDLLRegProc
)
retVal
=
(
*
lpfnDLLRegProc
)();
else
printf
(
"regapi: Couldn't find DllRegisterServer proc in '%s'.
\n
"
,
stdInput
);
if
(
retVal
!=
S_OK
)
printf
(
"regapi: DLLRegisterServer error 0x%x in '%s'.
\n
"
,
retVal
,
stdInput
);
FreeLibrary
(
theLib
);
}
else
{
printf
(
"regapi: Could not load DLL '%s'.
\n
"
,
stdInput
);
}
}
/******************************************************************************
* This funtion is the main entry point to the unregisterDLL action. It
* receives the currently read line, then loads and unregisters the requested DLLs
*/
static
void
doUnregisterDLL
(
LPSTR
stdInput
)
{
HMODULE
theLib
=
0
;
UINT
retVal
=
0
;
/* Check for valid input */
if
(
stdInput
==
NULL
)
return
;
/* Load and unregister the library, then free it */
theLib
=
LoadLibrary
(
stdInput
);
if
(
theLib
)
{
FARPROC
lpfnDLLRegProc
=
GetProcAddress
(
theLib
,
"DllUnregisterServer"
);
if
(
lpfnDLLRegProc
)
retVal
=
(
*
lpfnDLLRegProc
)();
else
printf
(
"regapi: Couldn't find DllUnregisterServer proc in '%s'.
\n
"
,
stdInput
);
if
(
retVal
!=
S_OK
)
printf
(
"regapi: DLLUnregisterServer error 0x%x in '%s'.
\n
"
,
retVal
,
stdInput
);
FreeLibrary
(
theLib
);
}
else
{
printf
(
"regapi: Could not load DLL '%s'.
\n
"
,
stdInput
);
}
}
/******************************************************************************
* MAIN - The main simply validate the first parameter (command to perform)
* It then read the STDIN lines by lines forwarding their processing
* to the appropriate method.
...
...
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