Removed some no longer used programs.
This commit is contained in:
parent
81d03dafdf
commit
177f3d1e25
|
@ -1448,7 +1448,6 @@ WINE_CONFIG_EXTRA_DIR(graphics/x11drv)
|
|||
WINE_CONFIG_EXTRA_DIR(include/wine)
|
||||
WINE_CONFIG_EXTRA_DIR(misc)
|
||||
WINE_CONFIG_EXTRA_DIR(objects)
|
||||
WINE_CONFIG_EXTRA_DIR(programs/regapi/tests)
|
||||
WINE_CONFIG_EXTRA_DIR(programs/regedit/tests)
|
||||
WINE_CONFIG_EXTRA_DIR(windows)
|
||||
|
||||
|
@ -1634,12 +1633,9 @@ programs/cmdlgtst/Makefile
|
|||
programs/control/Makefile
|
||||
programs/expand/Makefile
|
||||
programs/notepad/Makefile
|
||||
programs/osversioncheck/Makefile
|
||||
programs/progman/Makefile
|
||||
programs/regapi/Makefile
|
||||
programs/regedit/Makefile
|
||||
programs/regsvr32/Makefile
|
||||
programs/regtest/Makefile
|
||||
programs/rpcss/Makefile
|
||||
programs/rundll32/Makefile
|
||||
programs/start/Makefile
|
||||
|
|
|
@ -2,7 +2,6 @@ TOPSRCDIR = @top_srcdir@
|
|||
TOPOBJDIR = ..
|
||||
SRCDIR = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
MODULE = none
|
||||
|
||||
SUBDIRS = \
|
||||
avitools \
|
||||
|
@ -11,12 +10,9 @@ SUBDIRS = \
|
|||
control \
|
||||
expand \
|
||||
notepad \
|
||||
osversioncheck \
|
||||
progman \
|
||||
regapi \
|
||||
regedit \
|
||||
regsvr32 \
|
||||
regtest \
|
||||
rpcss \
|
||||
rundll32 \
|
||||
start \
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
Makefile
|
||||
osversioncheck.exe.dbg.c
|
||||
osversioncheck.exe.spec.c
|
|
@ -1,13 +0,0 @@
|
|||
TOPSRCDIR = @top_srcdir@
|
||||
TOPOBJDIR = ../..
|
||||
SRCDIR = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
MODULE = osversioncheck.exe
|
||||
APPMODE = cui
|
||||
IMPORTS = kernel32
|
||||
|
||||
C_SRCS = osversioncheck.c
|
||||
|
||||
@MAKE_PROG_RULES@
|
||||
|
||||
### Dependencies:
|
|
@ -1,96 +0,0 @@
|
|||
/*
|
||||
* Use the GetVersionEx() Win32 API call to show information about
|
||||
* which version of Windows we're running (or which version of Windows
|
||||
* Wine believes it is masquerading as).
|
||||
*
|
||||
* Copyright 1999 by Morten Eriksen <mailto:mortene@sim.no>
|
||||
*
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <windows.h>
|
||||
#include <winbase.h>
|
||||
#include <stdio.h>
|
||||
|
||||
void
|
||||
show_last_error(void)
|
||||
{
|
||||
DWORD lasterr;
|
||||
LPTSTR buffer;
|
||||
BOOL result;
|
||||
|
||||
lasterr = GetLastError();
|
||||
|
||||
result = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
|
||||
FORMAT_MESSAGE_FROM_SYSTEM |
|
||||
FORMAT_MESSAGE_IGNORE_INSERTS,
|
||||
NULL,
|
||||
lasterr,
|
||||
0,
|
||||
(LPTSTR)&buffer,
|
||||
0,
|
||||
NULL);
|
||||
|
||||
if (result) {
|
||||
fprintf(stderr, "Win32 API error (%ld):\t%s", lasterr, buffer);
|
||||
LocalFree((HLOCAL)buffer);
|
||||
}
|
||||
else {
|
||||
fprintf(stderr, "Win32 API error (%ld)", lasterr);
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char ** argv)
|
||||
|
||||
{
|
||||
BOOL result;
|
||||
OSVERSIONINFO oiv;
|
||||
|
||||
/* FIXME: GetVersionEx() is a Win32 API call, so there should be a
|
||||
preliminary check to see if we're running bare-bones Windows3.xx
|
||||
(or even lower?). 19990916 mortene. */
|
||||
|
||||
oiv.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
|
||||
result = GetVersionEx(&oiv);
|
||||
|
||||
if (result == FALSE) {
|
||||
show_last_error();
|
||||
}
|
||||
else {
|
||||
char * platforms[] = {
|
||||
"Win32s on Windows 3.1",
|
||||
"Win32 on Windows 95 or Windows 98",
|
||||
"Win32 on Windows NT/Windows 2000",
|
||||
"unknown!"
|
||||
};
|
||||
int platformval = 3;
|
||||
|
||||
switch (oiv.dwPlatformId) {
|
||||
case VER_PLATFORM_WIN32s: platformval = 0; break;
|
||||
case VER_PLATFORM_WIN32_WINDOWS: platformval = 1; break;
|
||||
case VER_PLATFORM_WIN32_NT: platformval = 2; break;
|
||||
}
|
||||
|
||||
fprintf(stdout,
|
||||
"MajorVersion: %ld\nMinorVersion: %ld\nBuildNumber: 0x%lx\n"
|
||||
"Platform: %s\nCSDVersion: '%s'\n",
|
||||
oiv.dwMajorVersion, oiv.dwMinorVersion, oiv.dwBuildNumber,
|
||||
platforms[platformval], oiv.szCSDVersion);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
Makefile
|
||||
regapi.exe.dbg.c
|
||||
regapi.exe.spec.c
|
|
@ -1,17 +0,0 @@
|
|||
TOPSRCDIR = @top_srcdir@
|
||||
TOPOBJDIR = ../..
|
||||
SRCDIR = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
MODULE = regapi.exe
|
||||
APPMODE = gui
|
||||
IMPORTS = advapi32 kernel32
|
||||
|
||||
C_SRCS = \
|
||||
regapi.c
|
||||
|
||||
PLTESTS = \
|
||||
tests/regapi.pl
|
||||
|
||||
@MAKE_PROG_RULES@
|
||||
|
||||
### Dependencies:
|
|
@ -1,81 +0,0 @@
|
|||
|
||||
Registry Command Line API Tool
|
||||
------------------------------
|
||||
|
||||
This progam is intended to fill a particular need. I needed to make the
|
||||
wine registry look like it would have been if my application would have
|
||||
been installed by its installation program. Since this was not possible I
|
||||
took the following approach.
|
||||
|
||||
1 - Use regedit to export my full Windows registry before I install my
|
||||
application.
|
||||
|
||||
2 - Use regedit to export my full Windows registry after I had install my
|
||||
application.
|
||||
|
||||
3 - Generate the differences between the two image. What I obtain from the
|
||||
diff is what I need to apply to the wine registry.
|
||||
|
||||
Obvisouly the process is not that straight forward to solve, first,
|
||||
you don't get the diff between two Windows regedit exported .reg file by
|
||||
doing a simple diff. What I had to do is a little more complex, but not
|
||||
that much...
|
||||
|
||||
(Assuming that the registry picture files are
|
||||
named ./before.reg and ./after.reg)
|
||||
|
||||
1 - Parse the before.reg and after.reg file into regFixer.pl, in order to
|
||||
obtain lines in the form [HKEY\Sub1\Sub2\...\Subn]"Value"="Data"
|
||||
(where "Data" can be prefixed by the type identifier : hex:, hex(0000000?)
|
||||
or dword:)
|
||||
|
||||
2 - Generate the diff between the before.reg.fix and after.reg.fix
|
||||
into app.diff
|
||||
|
||||
Now we have a app.reg file that contain what has been done by installing the
|
||||
application. To this we extract the parts that we are interested in using
|
||||
grep (and fix it with sed) and put that into app.added by example
|
||||
( let's say we keep the added values only ).
|
||||
|
||||
At this point we know which registry entry to add to the wine registry. It
|
||||
only remains to take the format we have and reset it into a format we get from
|
||||
regedit.
|
||||
|
||||
So, once you parsed app.added into regRestorer.pl you get an app.reg ready to
|
||||
process by regapi.
|
||||
|
||||
So, this package comes with a few pieces:
|
||||
|
||||
regFixer.pl - Will convert the export of regedit
|
||||
into something "diff-able"
|
||||
|
||||
regRestorer.pl - Will convert "cleaned" diff file into
|
||||
something "regapi-able"
|
||||
|
||||
regSet.sh - Will do the procedure explained herein
|
||||
for the added key only.
|
||||
|
||||
|
||||
FAQ
|
||||
---
|
||||
|
||||
Quick Start Guide
|
||||
-----------------
|
||||
1 - Get a snapshot of your windows registry in before.reg, (regedit/export)
|
||||
2 - Install your application,
|
||||
3 - Get a snapshot of your windows registry in after.reg.
|
||||
4 - Invoke ./regSet.sh before.reg after.reg
|
||||
|
||||
|
||||
Adding key I have in a regedit export file (nothing to diff with...)
|
||||
------------------------------------------
|
||||
1 - Invoke ./regSet.sh /dev/null myRegistry.reg
|
||||
|
||||
regapi help
|
||||
-----------
|
||||
1 - regapi has some sort of "man page like" help in it, simply invoke it
|
||||
without any arguments.
|
||||
|
||||
Hope this is of any use to you.
|
||||
|
||||
Sylvain St-Germain.
|
|
@ -1,41 +0,0 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
# This script takes as STDIN an output from the Registry
|
||||
# (export from regedit.exe) and prefixes every subkey-value
|
||||
# pair by their hkey,key data member
|
||||
#
|
||||
# Copyright 1999 Sylvain St-Germain
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
${prefix} = "";
|
||||
|
||||
LINE: while(<>) {
|
||||
chomp;
|
||||
s/\r$//; # Get rid of 0x0a
|
||||
|
||||
next LINE if(/^\s*$/); # This is an empty line
|
||||
next LINE if(/^\s*;/); # This is a comment (no way to diff it)
|
||||
|
||||
if( /^\[/ ) {
|
||||
${prefix} = ${_}; # assign the prefix for the forthcoming section
|
||||
${prefix} =~ s/\s+\d+$//; # get rid of timestamp
|
||||
print "${prefix}\n";
|
||||
next LINE;
|
||||
}
|
||||
|
||||
print "${prefix}$_\n";
|
||||
}
|
|
@ -1,71 +0,0 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
# This script takes as STDIN an output from the regFixer.pl
|
||||
# and reformat the file as if it would have been exported from the registry
|
||||
# in the "REGEDIT4" format.
|
||||
#
|
||||
# Copyright 1999 Sylvain St-Germain
|
||||
# Copyright 2002 Andriy Palamarchuk
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
use strict;
|
||||
use diagnostics;
|
||||
|
||||
# I do not validate the integrity of the file, I am assuming that
|
||||
# the input file comes from the output of regFixer.pl, therefore things
|
||||
# should be ok, if they are not, submit a bug
|
||||
|
||||
my $curr_key = "";
|
||||
my $key;
|
||||
my $value;
|
||||
my $rest;
|
||||
my $s;
|
||||
|
||||
print "REGEDIT4\n";
|
||||
|
||||
LINE: while($s = <>) {
|
||||
chomp($s); # get rid of new line
|
||||
|
||||
next LINE if($s =~ /^$/); # this is an empty line
|
||||
|
||||
if ($s =~ /\]$/) # only key name on the line
|
||||
{
|
||||
($key) = ($s =~ /^\[(.*)\]$/);
|
||||
unless ($key)
|
||||
{
|
||||
die "Unrecognized string $s";
|
||||
}
|
||||
if ($key ne $curr_key)
|
||||
{
|
||||
$curr_key = $key;
|
||||
print "\n[$key]\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
($key, $value) = ($s =~ /^\[(.*?)\](.+)$/);
|
||||
if (!defined($key))
|
||||
{
|
||||
die "Unrecognized string $s";
|
||||
}
|
||||
if ($key ne $curr_key) #curr_key might got chopped from regSet.sh
|
||||
{
|
||||
print "\n[$key]\n";
|
||||
}
|
||||
print "$value\n"
|
||||
}
|
||||
}
|
|
@ -1,92 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# This script is the receipe to generate the key that have to be created like
|
||||
# if an application was installed by its installer. It processes using a
|
||||
# registry based on the picture of the registry before the application is
|
||||
# installed and the picture of the registry after the application is installed.
|
||||
#
|
||||
# Copyright 1999 Sylvain St-Germain
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
if [ $# -ne 2 ]; then
|
||||
echo "$0 Usage: "
|
||||
echo " You must provide 2 arguments."
|
||||
echo " 1 - Registry output before the application's installation."
|
||||
echo " 2 - Registry output after the application's installation."
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f $1 ]; then echo "$1 does not exist."; exit 1; fi
|
||||
if [ ! -f $2 ]; then echo "$2 does not exist."; exit 1; fi
|
||||
|
||||
echo "Assuming that $1 is the \"before\" file..."
|
||||
echo "Assuming that $2 is the \"after\" file..."
|
||||
|
||||
#
|
||||
# do not attempt to regFix.pl /dev/null ...
|
||||
#
|
||||
echo "Fixing exported registry files..."
|
||||
|
||||
FIX1_FILE=`mktemp -q /tmp/file1_fix.XXXXXXXXX`
|
||||
FIX2_FILE=`mktemp -q /tmp/file2_fix.XXXXXXXXX`
|
||||
DIFF_FILE=`mktemp -q /tmp/file2_diff.XXXXXXXXX`
|
||||
FILE_TOADD_CLEAN=`mktemp -q /tmp/file_toAdd_clean.XXXXXXXXX`
|
||||
FILE_TOADD=`mktemp -q /tmp/file_toAdd.XXXXXXXXX`
|
||||
|
||||
if [ $1 != "/dev/null" ]; then
|
||||
cat $1 | ./regFixer.pl > $FIX1_FILE
|
||||
fi
|
||||
|
||||
cat $2 | ./regFixer.pl > $FIX2_FILE
|
||||
|
||||
|
||||
#
|
||||
# diff accordingly depending on /dev/null
|
||||
#
|
||||
echo "Diffing..."
|
||||
if [ $1 != "/dev/null" ]; then
|
||||
diff $FIX1_FILE $FIX2_FILE > $DIFF_FILE
|
||||
else
|
||||
diff /dev/null $FIX2_FILE > $DIFF_FILE
|
||||
fi
|
||||
|
||||
#
|
||||
# Keep only added lines
|
||||
#
|
||||
echo "Grepping keys to add and generating cleaned fixed registry file."
|
||||
cat $DIFF_FILE | grep '^> ' | sed -e 's/^> //' > $FILE_TOADD_CLEAN
|
||||
|
||||
#
|
||||
# Restore the file format to the regedit export 'like' format
|
||||
#
|
||||
echo "Restoring key's in the regedit export format..."
|
||||
cat $FILE_TOADD_CLEAN | ./regRestorer.pl > $FILE_TOADD
|
||||
|
||||
echo "Cleaning..."
|
||||
rm $FIX1_FILE $FIX2_FILE >/dev/null 2>&1
|
||||
rm $DIFF_FILE >/dev/null 2>&1
|
||||
rm $FILE_TOADD_CLEAN >/dev/null 2>&1
|
||||
|
||||
if mv $FILE_TOADD $2.toAdd
|
||||
then
|
||||
FILE_TOADD=$2.toAdd
|
||||
fi
|
||||
|
||||
echo "Operation completed, result file is '$FILE_TOADD'"
|
||||
|
||||
exit 0
|
File diff suppressed because it is too large
Load Diff
|
@ -1 +0,0 @@
|
|||
regapi.ok
|
|
@ -1,7 +0,0 @@
|
|||
Test data:
|
||||
|
||||
after.reg - registry file with the change, exported from regedit
|
||||
before.reg - registry file without the change, exported from regedit
|
||||
orig.reg - registry file ot the test change, exported from regedit
|
||||
|
||||
Note, orig.reg must me in Unix format, after.reg and before.reg - in Dos format.
|
|
@ -1,80 +0,0 @@
|
|||
REGEDIT4
|
||||
|
||||
[HKEY_CURRENT_USER]
|
||||
|
||||
[HKEY_CURRENT_USER\Software\WinCvs\wincvs\FileDetailView]
|
||||
"Column Widths"="150 50 50 100 150 150 150 "
|
||||
"Column Order"="0 1 2 3 4 5 6 "
|
||||
|
||||
[HKEY_CURRENT_USER\Software\WinCvs\wincvs\Settings]
|
||||
"Window Pos"="2,3,-1,-1,-1,-1,198,198,1062,828"
|
||||
|
||||
[HKEY_CURRENT_USER\Software\WinCvs\wincvs\Tip]
|
||||
"TimeStamp"="Mon Feb 11 13:20:51 2002"
|
||||
"StartUp"=dword:00000001
|
||||
"FilePos"=dword:00000247
|
||||
|
||||
[HKEY_CURRENT_USER\Test Regapi]
|
||||
|
||||
[HKEY_CURRENT_USER\Test Regapi\New Key #1]
|
||||
@="222Sample default value data, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long,end"
|
||||
"A- \" Binary Value #1, long name \\ []= long long long long long long long long long long long long end"=hex:30,\
|
||||
31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,\
|
||||
36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,\
|
||||
31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,\
|
||||
36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,\
|
||||
31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,\
|
||||
36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,\
|
||||
31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,\
|
||||
36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,\
|
||||
31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,\
|
||||
36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,\
|
||||
31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,\
|
||||
36
|
||||
"a1"=""
|
||||
"New Binary Value #2"=hex:
|
||||
"New DWORD Value #1"=dword:00000200
|
||||
"New DWORD Value #2"=dword:000000c9
|
||||
"New DWORD Value #3"=dword:00000000
|
||||
"New String Value #1"="One more long string value 1,2,3,4,5,6,7,8,9,0 1,2,3,4,5,6,7,8,9,0 1,2,3,4,5,6,7,8,9,0 1,2,3,4,5,6,7,8,9,0 1,2,3,4,5,6,7,8,9,0 1,2,3,4,5,6,7,8,9,0 1,2,3,4,5,6,7,8,9,0 1,2,3,4,5,6,7,8,9,0 1,2,3,4,5,6 end"
|
||||
"New String Value #2"=""
|
||||
"v1"="\" \\,=[]"
|
||||
|
||||
[HKEY_CURRENT_USER\Test Regapi\New Key #1\New Key #2]
|
||||
|
||||
[HKEY_CURRENT_USER\Test Regapi\New Key #1\New Key #2\New Key #3]
|
||||
|
||||
[HKEY_CURRENT_USER\Test Regapi\New Key #1\New Key #2\New Key #3\New Key #4]
|
||||
@=""
|
||||
|
||||
[HKEY_CURRENT_USER\Test Regapi\New Key #1\New Key #2\New Key #3\New Key #4\New Key #5]
|
||||
|
||||
[HKEY_CURRENT_USER\Test Regapi\New Key #1\New Key #2\New Key #3\New Key #4.1]
|
||||
|
||||
[HKEY_CURRENT_USER\Test Regapi\New Key #1\New Key #2\New Key #3\New Key #6]
|
||||
|
||||
[HKEY_CURRENT_USER\UNICODE Program Groups]
|
||||
|
||||
[HKEY_CURRENT_USER\Windows 3.1 Migration Status]
|
||||
|
||||
[HKEY_CURRENT_USER\Windows 3.1 Migration Status\Groups]
|
||||
|
||||
[HKEY_CURRENT_USER\Windows 3.1 Migration Status\IniFiles]
|
||||
|
||||
[HKEY_CURRENT_USER\Volatile Environment]
|
||||
"NWUSERNAME"="APalamar"
|
||||
"LOGONSERVER"="\\\\BX08N200"
|
||||
"=M:"="M:\\"
|
||||
"=O:"="O:\\"
|
||||
"=P:"="P:\\"
|
||||
"=U:"="U:\\"
|
||||
"=Z:"="Z:\\"
|
||||
"PATH"="Z:."
|
||||
"USERNAME"="APalamar"
|
||||
"=N:"="N:\\"
|
||||
"=Q:"="Q:\\"
|
||||
"=S:"="S:\\"
|
||||
"NWLANGUAGE"="English"
|
||||
"=T:"="T:\\"
|
||||
"WINDOWS_LOGIN"="0"
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
REGEDIT4
|
||||
|
||||
[HKEY_CURRENT_USER]
|
||||
|
||||
[HKEY_CURRENT_USER\Software\WinCvs\wincvs\FileDetailView]
|
||||
"Column Widths"="150 50 50 100 150 150 150 "
|
||||
"Column Order"="0 1 2 3 4 5 6 "
|
||||
|
||||
[HKEY_CURRENT_USER\Software\WinCvs\wincvs\Settings]
|
||||
"Window Pos"="2,3,-1,-1,-1,-1,198,198,1062,828"
|
||||
|
||||
[HKEY_CURRENT_USER\Software\WinCvs\wincvs\Tip]
|
||||
"TimeStamp"="Mon Feb 11 13:20:51 2002"
|
||||
"StartUp"=dword:00000001
|
||||
"FilePos"=dword:00000247
|
||||
|
||||
[HKEY_CURRENT_USER\UNICODE Program Groups]
|
||||
|
||||
[HKEY_CURRENT_USER\Windows 3.1 Migration Status]
|
||||
|
||||
[HKEY_CURRENT_USER\Windows 3.1 Migration Status\Groups]
|
||||
|
||||
[HKEY_CURRENT_USER\Windows 3.1 Migration Status\IniFiles]
|
||||
|
||||
[HKEY_CURRENT_USER\Volatile Environment]
|
||||
"NWUSERNAME"="APalamar"
|
||||
"LOGONSERVER"="\\\\BX08N200"
|
||||
"=M:"="M:\\"
|
||||
"=O:"="O:\\"
|
||||
"=P:"="P:\\"
|
||||
"=U:"="U:\\"
|
||||
"=Z:"="Z:\\"
|
||||
"PATH"="Z:."
|
||||
"USERNAME"="APalamar"
|
||||
"=N:"="N:\\"
|
||||
"=Q:"="Q:\\"
|
||||
"=S:"="S:\\"
|
||||
"NWLANGUAGE"="English"
|
||||
"=T:"="T:\\"
|
||||
"WINDOWS_LOGIN"="0"
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
REGEDIT4
|
||||
|
||||
[HKEY_CURRENT_USER\Test Regapi]
|
||||
|
||||
[HKEY_CURRENT_USER\Test Regapi\New Key #1]
|
||||
@="222Sample default value data, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long,end"
|
||||
"A- \" Binary Value #1, long name \\ []= long long long long long long long long long long long long end"=hex:30,\
|
||||
31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,\
|
||||
36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,\
|
||||
31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,\
|
||||
36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,\
|
||||
31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,\
|
||||
36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,\
|
||||
31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,\
|
||||
36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,\
|
||||
31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,\
|
||||
36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,\
|
||||
31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,\
|
||||
36
|
||||
"a1"=""
|
||||
"New Binary Value #2"=hex:
|
||||
"New DWORD Value #1"=dword:00000200
|
||||
"New DWORD Value #2"=dword:000000c9
|
||||
"New DWORD Value #3"=dword:00000000
|
||||
"New String Value #1"="One more long string value 1,2,3,4,5,6,7,8,9,0 1,2,3,4,5,6,7,8,9,0 1,2,3,4,5,6,7,8,9,0 1,2,3,4,5,6,7,8,9,0 1,2,3,4,5,6,7,8,9,0 1,2,3,4,5,6,7,8,9,0 1,2,3,4,5,6,7,8,9,0 1,2,3,4,5,6,7,8,9,0 1,2,3,4,5,6 end"
|
||||
"New String Value #2"=""
|
||||
"v1"="\" \\,=[]"
|
||||
|
||||
[HKEY_CURRENT_USER\Test Regapi\New Key #1\New Key #2]
|
||||
|
||||
[HKEY_CURRENT_USER\Test Regapi\New Key #1\New Key #2\New Key #3]
|
||||
|
||||
[HKEY_CURRENT_USER\Test Regapi\New Key #1\New Key #2\New Key #3\New Key #4]
|
||||
@=""
|
||||
|
||||
[HKEY_CURRENT_USER\Test Regapi\New Key #1\New Key #2\New Key #3\New Key #4\New Key #5]
|
||||
|
||||
[HKEY_CURRENT_USER\Test Regapi\New Key #1\New Key #2\New Key #3\New Key #4.1]
|
||||
|
||||
[HKEY_CURRENT_USER\Test Regapi\New Key #1\New Key #2\New Key #3\New Key #6]
|
|
@ -1,48 +0,0 @@
|
|||
#!/usr/bin/perl -w
|
||||
# This script tests regapi functionality
|
||||
#
|
||||
# Copyright 2002 Andriy Palamarchuk
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
use strict;
|
||||
use diagnostics;
|
||||
|
||||
test_diff();
|
||||
|
||||
#removes all test output files
|
||||
sub clear_output
|
||||
{
|
||||
unlink './tests/after.reg.toAdd';
|
||||
}
|
||||
|
||||
#tests scripts which implement "diff" functionality for registry
|
||||
sub test_diff
|
||||
{
|
||||
my $generated = './tests/after.reg.toAdd';
|
||||
my $orig = './tests/orig.reg';
|
||||
my $s;
|
||||
|
||||
$s = './regSet.sh ./tests/before.reg ./tests/after.reg > /dev/null';
|
||||
qx/$s/;
|
||||
|
||||
#files must be the same
|
||||
if (-z($generated) || (-s($generated) != -s($orig))) {
|
||||
die "Original and generated registry files ($orig and $generated) " .
|
||||
"are different";
|
||||
}
|
||||
clear_output();
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
Makefile
|
||||
regtest.exe.dbg.c
|
||||
regtest.exe.spec.c
|
|
@ -1,13 +0,0 @@
|
|||
TOPSRCDIR = @top_srcdir@
|
||||
TOPOBJDIR = ../..
|
||||
SRCDIR = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
MODULE = regtest.exe
|
||||
APPMODE = gui
|
||||
IMPORTS = advapi32 kernel32
|
||||
|
||||
C_SRCS = regtest.c
|
||||
|
||||
@MAKE_PROG_RULES@
|
||||
|
||||
### Dependencies:
|
|
@ -1,711 +0,0 @@
|
|||
/*
|
||||
* Registry testing program
|
||||
*
|
||||
* Copyright 1998 Matthew Becker
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* The return codes were generated in an NT40 environment, using lcc-win32
|
||||
*
|
||||
* NOTES
|
||||
* When compiling under lcc-win32, I get three (3) warning, but they all
|
||||
* seem to be issues with lcc.
|
||||
*
|
||||
* If creating a new testing sequence, please try to clean up any
|
||||
* registry changes that are made.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <windows.h>
|
||||
#include <winreg.h>
|
||||
#include <winerror.h>
|
||||
#include <winnt.h>
|
||||
|
||||
#ifndef __GNUC__
|
||||
#define __FUNCTION__ "<function>"
|
||||
#endif
|
||||
|
||||
/* True this when security is implemented */
|
||||
#define CHECK_SAM FALSE
|
||||
|
||||
#define xERROR(s,d) fprintf(stderr, "%s:#%d(Status=%ld)\n", __FUNCTION__,s,d)
|
||||
|
||||
/*
|
||||
* NOTES: These individual routines are listed in alphabetical order.
|
||||
*
|
||||
* They are meant to test error conditions. Success conditions are
|
||||
* tested in the sequences found at the end.
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
* TestCloseKey
|
||||
*/
|
||||
void TestCloseKey()
|
||||
{
|
||||
long lSts;
|
||||
|
||||
lSts = RegCloseKey((HKEY)2);
|
||||
if (lSts != ERROR_INVALID_HANDLE) xERROR(1,lSts);
|
||||
|
||||
lSts = RegCloseKey(HKEY_LOCAL_MACHINE);
|
||||
if (lSts != ERROR_SUCCESS) xERROR(2,lSts);
|
||||
|
||||
/* Check twice just for kicks */
|
||||
lSts = RegCloseKey(HKEY_LOCAL_MACHINE);
|
||||
if (lSts != ERROR_SUCCESS) xERROR(3,lSts);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* TestConnectRegistry
|
||||
*/
|
||||
void TestConnectRegistry()
|
||||
{
|
||||
long lSts;
|
||||
HKEY hkey;
|
||||
|
||||
lSts = RegConnectRegistry("",(HKEY)2,&hkey);
|
||||
if (lSts != ERROR_SUCCESS) xERROR(1,lSts);
|
||||
|
||||
lSts = RegConnectRegistry("",HKEY_LOCAL_MACHINE,&hkey);
|
||||
if (lSts != ERROR_SUCCESS) xERROR(2,lSts);
|
||||
|
||||
#if TOO_SLOW
|
||||
lSts = RegConnectRegistry("\\\\regtest",HKEY_LOCAL_MACHINE,&hkey);
|
||||
if (lSts != ERROR_BAD_NETPATH) xERROR(3,lSts);
|
||||
#endif
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* TestCreateKey
|
||||
*/
|
||||
void TestCreateKey()
|
||||
{
|
||||
long lSts;
|
||||
HKEY hkey;
|
||||
|
||||
lSts = RegCreateKey((HKEY)2,"",&hkey);
|
||||
if (lSts != ERROR_BADKEY) xERROR(1,lSts);
|
||||
|
||||
lSts = RegCreateKey(HKEY_LOCAL_MACHINE,"",&hkey);
|
||||
if (lSts != ERROR_SUCCESS) xERROR(2,lSts);
|
||||
RegCloseKey(hkey);
|
||||
|
||||
lSts = RegCreateKey(HKEY_LOCAL_MACHINE,"\\asdf",&hkey);
|
||||
if (lSts != ERROR_BAD_PATHNAME) xERROR(3,lSts);
|
||||
|
||||
#if 0
|
||||
lSts = RegCreateKey(HKEY_LOCAL_MACHINE,"asdf\\",&hkey);
|
||||
if (lSts != ERROR_INVALID_PARAMETER) xERROR(4,lSts);
|
||||
#endif
|
||||
|
||||
lSts = RegCreateKey(HKEY_LOCAL_MACHINE,"\\asdf\\",&hkey);
|
||||
if (lSts != ERROR_BAD_PATHNAME) xERROR(5,lSts);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* TestCreateKeyEx
|
||||
*/
|
||||
void TestCreateKeyEx()
|
||||
{
|
||||
long lSts;
|
||||
HKEY hkey;
|
||||
DWORD dwDisp;
|
||||
|
||||
lSts = RegCreateKeyEx((HKEY)2,"",0,"",0,0,NULL,&hkey,&dwDisp);
|
||||
if (lSts != ERROR_INVALID_HANDLE) xERROR(1,lSts);
|
||||
|
||||
lSts = RegCreateKeyEx(HKEY_LOCAL_MACHINE,"regtest",0,"",0,0,NULL,&hkey,
|
||||
&dwDisp);
|
||||
if (lSts != ERROR_INVALID_PARAMETER) xERROR(2,lSts);
|
||||
|
||||
lSts = RegCreateKeyEx(HKEY_LOCAL_MACHINE,"regtest",0,"asdf",0,
|
||||
KEY_ALL_ACCESS,NULL,&hkey,&dwDisp);
|
||||
if (lSts != ERROR_INVALID_PARAMETER) xERROR(3,lSts);
|
||||
|
||||
lSts = RegCreateKeyEx(HKEY_LOCAL_MACHINE,"regtest",0,"",0,
|
||||
KEY_ALL_ACCESS,NULL,&hkey,&dwDisp);
|
||||
if (lSts != ERROR_INVALID_PARAMETER) xERROR(4,lSts);
|
||||
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* TestCreateKeyEx
|
||||
*/
|
||||
void TestCreateKeyEx1()
|
||||
{
|
||||
long lSts;
|
||||
HKEY hkey,hkeyP;
|
||||
DWORD dwDisp;
|
||||
char keyname[]="regtest1";
|
||||
|
||||
lSts = RegOpenKeyEx(HKEY_LOCAL_MACHINE,"SOFTWARE",0,1,&hkeyP);
|
||||
if (lSts != ERROR_SUCCESS)
|
||||
{
|
||||
xERROR(1,lSts);
|
||||
return;
|
||||
}
|
||||
lSts = RegCreateKeyEx(hkeyP,keyname,0,0,0,0xf003f,0,&hkey,&dwDisp);
|
||||
if (lSts != ERROR_SUCCESS)
|
||||
{
|
||||
xERROR(2,lSts);
|
||||
RegCloseKey(hkeyP);
|
||||
return;
|
||||
}
|
||||
lSts = RegDeleteKey( hkeyP,keyname);
|
||||
if (lSts != ERROR_SUCCESS) xERROR(3,lSts);
|
||||
RegCloseKey(hkeyP);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* TestDeleteKey
|
||||
*/
|
||||
void TestDeleteKey()
|
||||
{
|
||||
long lSts;
|
||||
|
||||
lSts = RegDeleteKey((HKEY)2, "asdf");
|
||||
if (lSts != ERROR_INVALID_HANDLE) xERROR(1,lSts);
|
||||
|
||||
lSts = RegDeleteKey(HKEY_CURRENT_USER, "asdf");
|
||||
if (lSts != ERROR_FILE_NOT_FOUND) xERROR(2,lSts);
|
||||
|
||||
#if CHECK_SAM
|
||||
lSts = RegDeleteKey(HKEY_CURRENT_USER, "");
|
||||
if (lSts != ERROR_ACCESS_DENIED) xERROR(3,lSts);
|
||||
#endif
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* TestDeleteValue
|
||||
*/
|
||||
void TestDeleteValue()
|
||||
{
|
||||
long lSts;
|
||||
|
||||
lSts = RegDeleteValue((HKEY)2, "asdf");
|
||||
if (lSts != ERROR_INVALID_HANDLE) xERROR(1,lSts);
|
||||
|
||||
lSts = RegDeleteValue(HKEY_CURRENT_USER, "");
|
||||
if (lSts != ERROR_FILE_NOT_FOUND) xERROR(2,lSts);
|
||||
|
||||
lSts = RegDeleteValue(HKEY_CURRENT_USER, "asdf");
|
||||
if (lSts != ERROR_FILE_NOT_FOUND) xERROR(3,lSts);
|
||||
|
||||
lSts = RegDeleteValue(HKEY_CURRENT_USER, "\\asdf");
|
||||
if (lSts != ERROR_FILE_NOT_FOUND) xERROR(4,lSts);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* TestEnumKey
|
||||
*/
|
||||
void TestEnumKey()
|
||||
{
|
||||
long lSts;
|
||||
char *sVal;
|
||||
long lVal;
|
||||
|
||||
lVal = 1;
|
||||
sVal = (char *)malloc(lVal * sizeof(char));
|
||||
|
||||
lSts = RegEnumKey((HKEY)2,3,sVal,lVal);
|
||||
if (lSts != ERROR_INVALID_HANDLE) xERROR(1,lSts);
|
||||
|
||||
lSts = RegEnumKey(HKEY_CURRENT_USER,-1,sVal,lVal);
|
||||
if (lSts != ERROR_NO_MORE_ITEMS) xERROR(2,lSts);
|
||||
|
||||
lSts = RegEnumKey(HKEY_CURRENT_USER,0,sVal,lVal);
|
||||
if (lSts != ERROR_MORE_DATA) xERROR(3,lSts);
|
||||
|
||||
free(sVal);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* TestEnumKeyEx
|
||||
*/
|
||||
void TestEnumKeyEx()
|
||||
{
|
||||
long lSts;
|
||||
char *sVal;
|
||||
char *sClass;
|
||||
unsigned long lLen1;
|
||||
unsigned long lLen2;
|
||||
FILETIME ft;
|
||||
|
||||
lLen1 = 1;
|
||||
sVal = (char *)malloc(lLen1 * sizeof(char));
|
||||
lLen2 = 1;
|
||||
sClass = (char *)malloc(lLen2 * sizeof(char));
|
||||
|
||||
lSts = RegEnumKeyEx((HKEY)2,0,sVal,&lLen1,0,sClass,&lLen2,&ft);
|
||||
if (lSts != ERROR_INVALID_HANDLE) xERROR(1,lSts);
|
||||
|
||||
lSts = RegEnumKeyEx(HKEY_LOCAL_MACHINE,0,sVal,&lLen1,0,sClass,&lLen2,&ft);
|
||||
if (lSts != ERROR_MORE_DATA) xERROR(2,lSts);
|
||||
|
||||
lSts = RegEnumKeyEx(HKEY_LOCAL_MACHINE,0,sVal,&lLen1,0,sClass,&lLen2,&ft);
|
||||
if (lSts != ERROR_MORE_DATA) xERROR(3,lSts);
|
||||
|
||||
free(sVal);
|
||||
free(sClass);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* TestEnumValue
|
||||
*/
|
||||
void TestEnumValue()
|
||||
{
|
||||
long lSts;
|
||||
char *sVal;
|
||||
unsigned long lVal;
|
||||
unsigned long lType;
|
||||
unsigned long lLen1;
|
||||
char *bVal;
|
||||
|
||||
lVal = 1;
|
||||
sVal = (char *)malloc(lVal * sizeof(char));
|
||||
lLen1 = 1;
|
||||
bVal = (char *)malloc(lLen1 * sizeof(char));
|
||||
|
||||
lSts = RegEnumValue((HKEY)2,-1,sVal,&lVal,0,&lType,NULL,&lLen1);
|
||||
if (lSts != ERROR_INVALID_HANDLE) xERROR(1,lSts);
|
||||
|
||||
lSts = RegEnumValue(HKEY_LOCAL_MACHINE,-1,sVal,&lVal,0,&lType,NULL,&lLen1);
|
||||
if (lSts != ERROR_NO_MORE_ITEMS) xERROR(2,lSts);
|
||||
|
||||
lSts = RegEnumValue(HKEY_LOCAL_MACHINE,0,sVal,&lVal,0,&lType,NULL,&lLen1);
|
||||
if (lSts != ERROR_SUCCESS) xERROR(3,lSts);
|
||||
|
||||
lSts = RegEnumValue(HKEY_LOCAL_MACHINE,0,sVal,&lVal,0,NULL,NULL,&lLen1);
|
||||
if (lSts != ERROR_SUCCESS) xERROR(4,lSts);
|
||||
|
||||
lSts = RegEnumValue(HKEY_LOCAL_MACHINE,1,sVal,&lVal,0,&lType,bVal,&lLen1);
|
||||
if (lSts != ERROR_NO_MORE_ITEMS) xERROR(5,lSts);
|
||||
|
||||
free(sVal);
|
||||
free(bVal);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* TestFlushKey
|
||||
*/
|
||||
void TestFlushKey()
|
||||
{
|
||||
long lSts;
|
||||
|
||||
lSts = RegFlushKey((HKEY)2);
|
||||
if (lSts != ERROR_INVALID_HANDLE) xERROR(1,lSts);
|
||||
|
||||
lSts = RegFlushKey(HKEY_LOCAL_MACHINE);
|
||||
if (lSts != ERROR_SUCCESS) xERROR(2,lSts);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* TestGetKeySecurity
|
||||
*/
|
||||
void TestGetKeySecurity()
|
||||
{
|
||||
long lSts;
|
||||
SECURITY_INFORMATION si;
|
||||
SECURITY_DESCRIPTOR sd;
|
||||
unsigned long lLen;
|
||||
|
||||
lLen = sizeof(sd);
|
||||
si = 0;
|
||||
lSts = RegGetKeySecurity((HKEY)2,si,&sd,&lLen);
|
||||
if (lSts != ERROR_INVALID_HANDLE) xERROR(1,lSts);
|
||||
|
||||
lSts = RegGetKeySecurity(HKEY_LOCAL_MACHINE,si,&sd,&lLen);
|
||||
if (lSts != ERROR_INSUFFICIENT_BUFFER) xERROR(2,lSts);
|
||||
|
||||
si = GROUP_SECURITY_INFORMATION;
|
||||
lSts = RegGetKeySecurity(HKEY_LOCAL_MACHINE,si,&sd,&lLen);
|
||||
if (lSts != ERROR_SUCCESS) xERROR(3,lSts);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* TestLoadKey
|
||||
*/
|
||||
void TestLoadKey()
|
||||
{
|
||||
long lSts;
|
||||
|
||||
lSts = RegLoadKey((HKEY)2,"","");
|
||||
if (lSts != ERROR_INVALID_PARAMETER) xERROR(1,lSts);
|
||||
|
||||
lSts = RegLoadKey(HKEY_CURRENT_USER,"","");
|
||||
if (lSts != ERROR_INVALID_PARAMETER) xERROR(2,lSts);
|
||||
|
||||
lSts = RegLoadKey(HKEY_CURRENT_USER,"regtest","");
|
||||
if (lSts != ERROR_INVALID_PARAMETER) xERROR(3,lSts);
|
||||
|
||||
lSts = RegLoadKey(HKEY_CURRENT_USER,"\\regtest","");
|
||||
if (lSts != ERROR_INVALID_PARAMETER) xERROR(4,lSts);
|
||||
|
||||
#if CHECK_SAM
|
||||
lSts = RegLoadKey(HKEY_CURRENT_USER,"regtest","regtest.dat");
|
||||
if (lSts != ERROR_PRIVILEGE_NOT_HELD) xERROR(5,lSts);
|
||||
|
||||
lSts = RegLoadKey(HKEY_CURRENT_USER,"\\regtest","regtest.dat");
|
||||
if (lSts != ERROR_PRIVILEGE_NOT_HELD) xERROR(6,lSts);
|
||||
#endif
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* TestNotifyChangeKeyValue
|
||||
*/
|
||||
void TestNotifyChangeKeyValue()
|
||||
{
|
||||
long lSts;
|
||||
HANDLE hEvent;
|
||||
|
||||
hEvent = 0;
|
||||
|
||||
lSts = RegNotifyChangeKeyValue((HKEY)2, TRUE, REG_NOTIFY_CHANGE_NAME, 0, 0);
|
||||
if (lSts != ERROR_INVALID_HANDLE) xERROR(1,lSts);
|
||||
|
||||
lSts = RegNotifyChangeKeyValue(HKEY_CURRENT_USER, TRUE, REG_NOTIFY_CHANGE_NAME, 0, 1);
|
||||
if (lSts != ERROR_INVALID_PARAMETER) xERROR(2,lSts);
|
||||
|
||||
hEvent = (HANDLE)HKEY_CURRENT_USER;
|
||||
lSts = RegNotifyChangeKeyValue(HKEY_CURRENT_USER, TRUE, REG_NOTIFY_CHANGE_NAME, hEvent, 1);
|
||||
if (lSts != ERROR_INVALID_HANDLE) xERROR(3,lSts);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* TestOpenKey
|
||||
*/
|
||||
void TestOpenKey()
|
||||
{
|
||||
long lSts;
|
||||
HKEY hkey;
|
||||
|
||||
lSts = RegOpenKey((HKEY)72, "",&hkey);
|
||||
if (lSts != ERROR_SUCCESS) xERROR(1,lSts);
|
||||
RegCloseKey(hkey);
|
||||
|
||||
lSts = RegOpenKey((HKEY)2, "regtest",&hkey);
|
||||
if (lSts != ERROR_INVALID_HANDLE) xERROR(2,lSts);
|
||||
|
||||
lSts = RegOpenKey(HKEY_CURRENT_USER, "regtest",&hkey);
|
||||
if (lSts != ERROR_FILE_NOT_FOUND) xERROR(3,lSts);
|
||||
|
||||
lSts = RegOpenKey(HKEY_CURRENT_USER, "\\regtest",&hkey);
|
||||
if (lSts != ERROR_BAD_PATHNAME) xERROR(4,lSts);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* TestOpenKeyEx
|
||||
*/
|
||||
void TestOpenKeyEx()
|
||||
{
|
||||
long lSts;
|
||||
HKEY hkey;
|
||||
|
||||
lSts = RegOpenKeyEx((HKEY)2,"",0,KEY_ALL_ACCESS,&hkey);
|
||||
if (lSts != ERROR_INVALID_HANDLE) xERROR(1,lSts);
|
||||
|
||||
lSts = RegOpenKeyEx(HKEY_CURRENT_USER,"\\regtest",0,KEY_ALL_ACCESS,&hkey);
|
||||
if (lSts != ERROR_BAD_PATHNAME) xERROR(2,lSts);
|
||||
|
||||
lSts = RegOpenKeyEx(HKEY_CURRENT_USER,"regtest",0,0,&hkey);
|
||||
if (lSts != ERROR_FILE_NOT_FOUND) xERROR(3,lSts);
|
||||
|
||||
lSts = RegOpenKeyEx(HKEY_CURRENT_USER,"regtest\\",0,0,&hkey);
|
||||
if (lSts != ERROR_FILE_NOT_FOUND) xERROR(4,lSts);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* TestQueryInfoKey
|
||||
*/
|
||||
void TestQueryInfoKey()
|
||||
{
|
||||
long lSts;
|
||||
char *sClass;
|
||||
unsigned long lClass;
|
||||
unsigned long lSubKeys;
|
||||
unsigned long lMaxSubLen;
|
||||
unsigned long lMaxClassLen;
|
||||
unsigned long lValues;
|
||||
unsigned long lMaxValNameLen;
|
||||
unsigned long lMaxValLen;
|
||||
unsigned long lSecDescLen;
|
||||
FILETIME ft;
|
||||
|
||||
lClass = 1;
|
||||
sClass = (char *)malloc(lClass * sizeof(char));
|
||||
|
||||
lSts = RegQueryInfoKey((HKEY)2,sClass,&lClass,0,&lSubKeys,&lMaxSubLen,
|
||||
&lMaxClassLen,&lValues,&lMaxValNameLen,&lMaxValLen,
|
||||
&lSecDescLen, &ft);
|
||||
if (lSts != ERROR_INVALID_HANDLE) xERROR(1,lSts);
|
||||
|
||||
lSts = RegQueryInfoKey(HKEY_CURRENT_USER,sClass,&lClass,0,&lSubKeys,
|
||||
&lMaxSubLen,&lMaxClassLen,&lValues,&lMaxValNameLen,
|
||||
&lMaxValLen,&lSecDescLen, &ft);
|
||||
if (lSts != ERROR_SUCCESS) xERROR(2,lSts);
|
||||
|
||||
free(sClass);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* TestQueryValue
|
||||
*/
|
||||
void TestQueryValue()
|
||||
{
|
||||
long lSts;
|
||||
long lLen;
|
||||
char *sVal;
|
||||
|
||||
sVal = (char *)malloc(80 * sizeof(char));
|
||||
lLen = strlen(sVal);
|
||||
|
||||
lSts = RegQueryValue((HKEY)2,"",NULL,&lLen);
|
||||
if (lSts != ERROR_INVALID_HANDLE) xERROR(1,lSts);
|
||||
|
||||
lSts = RegQueryValue(HKEY_CURRENT_USER,"",NULL,&lLen);
|
||||
if (lSts != ERROR_SUCCESS) xERROR(2,lSts);
|
||||
|
||||
lSts = RegQueryValue(HKEY_CURRENT_USER,"\\regtest",NULL,&lLen);
|
||||
if (lSts != ERROR_BAD_PATHNAME) xERROR(3,lSts);
|
||||
|
||||
lSts = RegQueryValue(HKEY_CURRENT_USER,"",sVal,&lLen);
|
||||
if (lSts != ERROR_SUCCESS) xERROR(4,lSts);
|
||||
|
||||
free(sVal);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* TestQueryValueEx
|
||||
*/
|
||||
void TestQueryValueEx()
|
||||
{
|
||||
char *sVal;
|
||||
long lSts;
|
||||
unsigned long lType;
|
||||
unsigned long lLen;
|
||||
|
||||
lLen = 80;
|
||||
sVal = (char *)malloc(lLen * sizeof(char));
|
||||
|
||||
lSts = RegQueryValueEx((HKEY)2,"",0,&lType,sVal,&lLen);
|
||||
if (lSts != ERROR_INVALID_HANDLE) xERROR(1,lSts);
|
||||
|
||||
lSts = RegQueryValueEx(HKEY_CURRENT_USER,"",(LPDWORD)1,&lType,sVal,&lLen);
|
||||
if (lSts != ERROR_INVALID_PARAMETER) xERROR(2,lSts);
|
||||
|
||||
lSts = RegQueryValueEx(HKEY_LOCAL_MACHINE,"",0,&lType,sVal,&lLen);
|
||||
if (lSts != ERROR_SUCCESS) xERROR(3,lSts);
|
||||
|
||||
free(sVal);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* TestReplaceKey
|
||||
*/
|
||||
void TestReplaceKey()
|
||||
{
|
||||
long lSts;
|
||||
|
||||
lSts = RegReplaceKey((HKEY)2,"","","");
|
||||
if (lSts != ERROR_INVALID_HANDLE) xERROR(1,lSts);
|
||||
|
||||
#if CHECK_SAM
|
||||
lSts = RegReplaceKey(HKEY_LOCAL_MACHINE,"","","");
|
||||
if (lSts != ERROR_ACCESS_DENIED) xERROR(2,lSts);
|
||||
|
||||
lSts = RegReplaceKey(HKEY_LOCAL_MACHINE,"Software","","");
|
||||
if (lSts != ERROR_ACCESS_DENIED) xERROR(3,lSts);
|
||||
#endif
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* TestRestoreKey
|
||||
*/
|
||||
void TestRestoreKey()
|
||||
{
|
||||
long lSts;
|
||||
|
||||
lSts = RegRestoreKey((HKEY)2,"",0);
|
||||
if (lSts != ERROR_INVALID_PARAMETER) xERROR(1,lSts);
|
||||
|
||||
lSts = RegRestoreKey(HKEY_LOCAL_MACHINE,"",0);
|
||||
if (lSts != ERROR_INVALID_PARAMETER) xERROR(2,lSts);
|
||||
|
||||
lSts = RegRestoreKey(HKEY_LOCAL_MACHINE,"a.a",0);
|
||||
if (lSts != ERROR_FILE_NOT_FOUND) xERROR(3,lSts);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* TestSaveKey
|
||||
*/
|
||||
void TestSaveKey()
|
||||
{
|
||||
long lSts;
|
||||
|
||||
lSts = RegSaveKey((HKEY)2,"",NULL);
|
||||
if (lSts != ERROR_INVALID_PARAMETER) xERROR(1,lSts);
|
||||
|
||||
lSts = RegSaveKey(HKEY_LOCAL_MACHINE,"",NULL);
|
||||
if (lSts != ERROR_INVALID_PARAMETER) xERROR(2,lSts);
|
||||
|
||||
#if CHECK_SAM
|
||||
lSts = RegSaveKey(HKEY_LOCAL_MACHINE,"a.a",NULL);
|
||||
if (lSts != ERROR_PRIVILEGE_NOT_HELD) xERROR(3,lSts);
|
||||
#endif
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* TestSetKeySecurity
|
||||
*/
|
||||
void TestSetKeySecurity()
|
||||
{
|
||||
long lSts;
|
||||
SECURITY_DESCRIPTOR sd;
|
||||
|
||||
lSts = RegSetKeySecurity((HKEY)2,0,NULL);
|
||||
if (lSts != ERROR_INVALID_PARAMETER) xERROR(1,lSts);
|
||||
|
||||
lSts = RegSetKeySecurity(HKEY_LOCAL_MACHINE,0,NULL);
|
||||
if (lSts != ERROR_INVALID_PARAMETER) xERROR(2,lSts);
|
||||
|
||||
lSts = RegSetKeySecurity(HKEY_LOCAL_MACHINE,OWNER_SECURITY_INFORMATION,NULL);
|
||||
if (lSts != ERROR_INVALID_PARAMETER) xERROR(3,lSts);
|
||||
|
||||
lSts = RegSetKeySecurity(HKEY_LOCAL_MACHINE,OWNER_SECURITY_INFORMATION,&sd);
|
||||
if (lSts != ERROR_INVALID_PARAMETER) xERROR(4,lSts);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* TestSetValue
|
||||
*/
|
||||
void TestSetValue()
|
||||
{
|
||||
#if MAKE_NT_CRASH
|
||||
long lSts;
|
||||
#endif
|
||||
|
||||
#if MAKE_NT_CRASH
|
||||
lSts = RegSetValue((HKEY)2,"",0,NULL,0);
|
||||
if (lSts != ERROR_INVALID_PARAMETER) xERROR(1,lSts);
|
||||
#endif
|
||||
|
||||
#if MAKE_NT_CRASH
|
||||
lSts = RegSetValue((HKEY)2,"regtest",0,NULL,0);
|
||||
if (lSts != ERROR_INVALID_PARAMETER) xERROR(2,lSts);
|
||||
#endif
|
||||
|
||||
#if MAKE_NT_CRASH
|
||||
lSts = RegSetValue((HKEY)2,"regtest",REG_SZ,NULL,0);
|
||||
if (lSts != ERROR_INVALID_HANDLE) xERROR(3,lSts);
|
||||
#endif
|
||||
|
||||
#if MAKE_NT_CRASH
|
||||
lSts = RegSetValue(HKEY_LOCAL_MACHINE,"regtest",REG_SZ,NULL,0);
|
||||
if (lSts != ERROR_INVALID_HANDLE) xERROR(4,lSts);
|
||||
#endif
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* TestSetValueEx
|
||||
*/
|
||||
void TestSetValueEx()
|
||||
{
|
||||
long lSts;
|
||||
|
||||
lSts = RegSetValueEx((HKEY)2,"",0,0,NULL,0);
|
||||
if (lSts != ERROR_INVALID_HANDLE) xERROR(1,lSts);
|
||||
|
||||
lSts = RegSetValueEx(HKEY_LOCAL_MACHINE,"",0,0,NULL,0);
|
||||
if (lSts != ERROR_SUCCESS) xERROR(2,lSts);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* TestUnLoadKey
|
||||
*/
|
||||
void TestUnLoadKey()
|
||||
{
|
||||
#if CHECK_SAM
|
||||
long lSts;
|
||||
#endif
|
||||
|
||||
#if CHECK_SAM
|
||||
lSts = RegUnLoadKey((HKEY)2,"");
|
||||
if (lSts != ERROR_PRIVILEGE_NOT_HELD) xERROR(1,lSts);
|
||||
|
||||
lSts = RegUnLoadKey(HKEY_LOCAL_MACHINE,"");
|
||||
if (lSts != ERROR_PRIVILEGE_NOT_HELD) xERROR(2,lSts);
|
||||
|
||||
lSts = RegUnLoadKey(HKEY_LOCAL_MACHINE,"\\regtest");
|
||||
if (lSts != ERROR_PRIVILEGE_NOT_HELD) xERROR(3,lSts);
|
||||
#endif
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* TestSequence1
|
||||
*/
|
||||
void TestSequence1()
|
||||
{
|
||||
HKEY hkey;
|
||||
long lSts;
|
||||
|
||||
lSts = RegCreateKey(HKEY_CURRENT_USER,"regtest",&hkey);
|
||||
if (lSts != ERROR_SUCCESS) xERROR(1,lSts);
|
||||
|
||||
/* fprintf(stderr, " hkey=0x%x\n", hkey); */
|
||||
|
||||
lSts = RegDeleteKey(HKEY_CURRENT_USER, "regtest");
|
||||
if (lSts != ERROR_SUCCESS) xERROR(2,lSts);
|
||||
lSts = RegCloseKey(hkey);
|
||||
if (lSts != ERROR_SUCCESS) xERROR(3,lSts);
|
||||
}
|
||||
|
||||
|
||||
int PASCAL WinMain (HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
|
||||
{
|
||||
|
||||
/* These can be in any order */
|
||||
TestCloseKey();
|
||||
TestConnectRegistry();
|
||||
TestCreateKey();
|
||||
TestCreateKeyEx();
|
||||
TestDeleteKey();
|
||||
TestDeleteValue();
|
||||
TestEnumKey();
|
||||
TestEnumKeyEx();
|
||||
TestEnumValue();
|
||||
TestFlushKey();
|
||||
TestGetKeySecurity();
|
||||
TestLoadKey();
|
||||
TestNotifyChangeKeyValue();
|
||||
TestOpenKey();
|
||||
TestOpenKeyEx();
|
||||
TestQueryInfoKey();
|
||||
TestQueryValue();
|
||||
TestQueryValueEx();
|
||||
TestReplaceKey();
|
||||
TestRestoreKey();
|
||||
TestSaveKey();
|
||||
TestSetKeySecurity();
|
||||
TestSetValue();
|
||||
TestSetValueEx();
|
||||
TestUnLoadKey();
|
||||
TestCreateKeyEx1();
|
||||
|
||||
/* Now we have some sequence testing */
|
||||
TestSequence1();
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -1,70 +0,0 @@
|
|||
#!/usr/bin/perl
|
||||
#
|
||||
# Update the list of debug channels of a given spec file
|
||||
#
|
||||
# Copyright 2000 Alexandre Julliard
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
# Usage: make_debug spec_file [source_files...]
|
||||
#
|
||||
|
||||
die "Usage: make_debug spec_file [source]\n" unless @ARGV;
|
||||
|
||||
$SPEC = shift @ARGV;
|
||||
|
||||
# read in all the source files
|
||||
if (@ARGV)
|
||||
{
|
||||
while (<>)
|
||||
{
|
||||
if (/DECLARE_DEBUG_CHANNEL\s*\(\s*([A-Za-z0-9_]+)\s*\)/) { $channels{$1} = 1; }
|
||||
if (/DEFAULT_DEBUG_CHANNEL\s*\(\s*([A-Za-z0-9_]+)\s*\)/) { $channels{$1} = 1; }
|
||||
}
|
||||
}
|
||||
@dbg_channels = sort keys %channels;
|
||||
|
||||
# read the whole spec file
|
||||
undef $/;
|
||||
open SPEC or die "Cannot open $SPEC\n";
|
||||
$spec = <SPEC>;
|
||||
close SPEC;
|
||||
|
||||
# build the new channel list
|
||||
$channel_str = "debug_channels (";
|
||||
$pos = length($channel_str);
|
||||
for ($i = 0; $i <= $#dbg_channels; $i++)
|
||||
{
|
||||
$channel_str .= $dbg_channels[$i];
|
||||
$pos += length($dbg_channels[$i]);
|
||||
if ($i < $#dbg_channels)
|
||||
{
|
||||
if ($pos >= 75) { $pos = 16; $channel_str .= "\n" . (" " x $pos); }
|
||||
else { $channel_str .= " "; $pos++; }
|
||||
}
|
||||
}
|
||||
$channel_str .= ")";
|
||||
|
||||
# replace the list in the spec file
|
||||
if (!($spec =~ s/debug_channels\s*\(([^)]*)\)/$channel_str/))
|
||||
{
|
||||
die "Could not replace debug_channels\n" if @dbg_channels;
|
||||
exit 0;
|
||||
}
|
||||
|
||||
# output the modified spec file
|
||||
open OUTPUT, ">$SPEC" or die "Cannot modify $SPEC\n";
|
||||
print OUTPUT $spec;
|
||||
close OUTPUT;
|
Loading…
Reference in New Issue