From 177f3d1e2558fd5affa41446c266ccce94b38ee9 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Sun, 30 Nov 2003 01:55:54 +0000 Subject: [PATCH] Removed some no longer used programs. --- configure | 10 +- configure.ac | 4 - programs/Makefile.in | 4 - programs/osversioncheck/.cvsignore | 3 - programs/osversioncheck/Makefile.in | 13 - programs/osversioncheck/osversioncheck.c | 96 --- programs/regapi/.cvsignore | 3 - programs/regapi/Makefile.in | 17 - programs/regapi/README | 81 --- programs/regapi/regFixer.pl | 41 -- programs/regapi/regRestorer.pl | 71 -- programs/regapi/regSet.sh | 92 --- programs/regapi/regapi.c | 1106 ------------------------------ programs/regapi/tests/.cvsignore | 1 - programs/regapi/tests/README | 7 - programs/regapi/tests/after.reg | 80 --- programs/regapi/tests/before.reg | 41 -- programs/regapi/tests/orig.reg | 40 -- programs/regapi/tests/regapi.pl | 48 -- programs/regtest/.cvsignore | 3 - programs/regtest/Makefile.in | 13 - programs/regtest/regtest.c | 711 ------------------- tools/make_debug | 70 -- 23 files changed, 1 insertion(+), 2554 deletions(-) delete mode 100644 programs/osversioncheck/.cvsignore delete mode 100644 programs/osversioncheck/Makefile.in delete mode 100644 programs/osversioncheck/osversioncheck.c delete mode 100644 programs/regapi/.cvsignore delete mode 100644 programs/regapi/Makefile.in delete mode 100644 programs/regapi/README delete mode 100755 programs/regapi/regFixer.pl delete mode 100755 programs/regapi/regRestorer.pl delete mode 100755 programs/regapi/regSet.sh delete mode 100644 programs/regapi/regapi.c delete mode 100644 programs/regapi/tests/.cvsignore delete mode 100644 programs/regapi/tests/README delete mode 100644 programs/regapi/tests/after.reg delete mode 100644 programs/regapi/tests/before.reg delete mode 100644 programs/regapi/tests/orig.reg delete mode 100644 programs/regapi/tests/regapi.pl delete mode 100644 programs/regtest/.cvsignore delete mode 100644 programs/regtest/Makefile.in delete mode 100644 programs/regtest/regtest.c delete mode 100755 tools/make_debug diff --git a/configure b/configure index b98f7a321ee..310c609b9b7 100755 --- a/configure +++ b/configure @@ -17195,8 +17195,6 @@ esac ac_config_commands="$ac_config_commands objects" - ac_config_commands="$ac_config_commands programs/regapi/tests" - ac_config_commands="$ac_config_commands programs/regedit/tests" ac_config_commands="$ac_config_commands windows" @@ -17217,7 +17215,7 @@ MAKE_LIB_RULES=libs/Makelib.rules MAKE_PROG_RULES=programs/Makeprog.rules - ac_config_files="$ac_config_files Make.rules dlls/Makedll.rules dlls/Maketest.rules libs/Makelib.rules programs/Makeprog.rules Makefile dlls/Makefile dlls/advapi32/Makefile dlls/advapi32/tests/Makefile dlls/avicap32/Makefile dlls/avifil32/Makefile dlls/cabinet/Makefile dlls/capi2032/Makefile dlls/cfgmgr32/Makefile dlls/comcat/Makefile dlls/comctl32/Makefile dlls/comctl32/tests/Makefile dlls/commdlg/Makefile dlls/crtdll/Makefile dlls/crypt32/Makefile dlls/ctl3d/Makefile dlls/wined3d/Makefile dlls/d3d8/Makefile dlls/d3d9/Makefile dlls/d3dim/Makefile dlls/d3dx8/Makefile dlls/dciman32/Makefile dlls/ddraw/Makefile dlls/ddraw/tests/Makefile dlls/devenum/Makefile dlls/dinput/Makefile dlls/dinput8/Makefile dlls/dmband/Makefile dlls/dmcompos/Makefile dlls/dmime/Makefile dlls/dmloader/Makefile dlls/dmscript/Makefile dlls/dmstyle/Makefile dlls/dmsynth/Makefile dlls/dmusic/Makefile dlls/dmusic32/Makefile dlls/dplay/Makefile dlls/dplayx/Makefile dlls/dpnhpast/Makefile dlls/dsound/Makefile dlls/dsound/tests/Makefile dlls/gdi/Makefile dlls/gdi/tests/Makefile dlls/glu32/Makefile dlls/icmp/Makefile dlls/imagehlp/Makefile dlls/imm32/Makefile dlls/iphlpapi/Makefile dlls/kernel/Makefile dlls/kernel/tests/Makefile dlls/lzexpand/Makefile dlls/mapi32/Makefile dlls/mpr/Makefile dlls/msacm/Makefile dlls/msacm/imaadp32/Makefile dlls/msacm/msadp32/Makefile dlls/msacm/msg711/Makefile dlls/msacm/winemp3/Makefile dlls/msdmo/Makefile dlls/mshtml/Makefile dlls/msi/Makefile dlls/msimg32/Makefile dlls/msisys/Makefile dlls/msnet32/Makefile dlls/msvcrt/Makefile dlls/msvcrt/tests/Makefile dlls/msvcrt20/Makefile dlls/msvcrtd/Makefile dlls/msvideo/Makefile dlls/msvideo/msrle32/Makefile dlls/mswsock/Makefile dlls/netapi32/Makefile dlls/netapi32/tests/Makefile dlls/ntdll/Makefile dlls/ntdll/tests/Makefile dlls/odbc32/Makefile dlls/ole32/Makefile dlls/oleacc/Makefile dlls/oleaut32/Makefile dlls/oleaut32/tests/Makefile dlls/olecli/Makefile dlls/oledlg/Makefile dlls/olepro32/Makefile dlls/olesvr/Makefile dlls/opengl32/Makefile dlls/psapi/Makefile dlls/qcap/Makefile dlls/quartz/Makefile dlls/rasapi32/Makefile dlls/richedit/Makefile dlls/rpcrt4/Makefile dlls/rpcrt4/tests/Makefile dlls/serialui/Makefile dlls/setupapi/Makefile dlls/shdocvw/Makefile dlls/shell32/Makefile dlls/shell32/tests/Makefile dlls/shfolder/Makefile dlls/shlwapi/Makefile dlls/shlwapi/tests/Makefile dlls/snmpapi/Makefile dlls/sti/Makefile dlls/tapi32/Makefile dlls/ttydrv/Makefile dlls/twain/Makefile dlls/unicows/Makefile dlls/url/Makefile dlls/urlmon/Makefile dlls/urlmon/tests/Makefile dlls/user/Makefile dlls/user/tests/Makefile dlls/uxtheme/Makefile dlls/version/Makefile dlls/win32s/Makefile dlls/winaspi/Makefile dlls/winedos/Makefile dlls/wineps/Makefile dlls/wininet/Makefile dlls/wininet/tests/Makefile dlls/winmm/Makefile dlls/winmm/joystick/Makefile dlls/winmm/mcianim/Makefile dlls/winmm/mciavi/Makefile dlls/winmm/mcicda/Makefile dlls/winmm/mciseq/Makefile dlls/winmm/mciwave/Makefile dlls/winmm/midimap/Makefile dlls/winmm/tests/Makefile dlls/winmm/wavemap/Makefile dlls/winmm/winealsa/Makefile dlls/winmm/winearts/Makefile dlls/winmm/wineaudioio/Makefile dlls/winmm/winenas/Makefile dlls/winmm/winejack/Makefile dlls/winmm/wineoss/Makefile dlls/winnls/Makefile dlls/winsock/Makefile dlls/winsock/tests/Makefile dlls/winspool/Makefile dlls/winspool/tests/Makefile dlls/wintab32/Makefile dlls/wintrust/Makefile dlls/wow32/Makefile dlls/wsock32/Makefile dlls/x11drv/Makefile documentation/Makefile include/Makefile libs/Makefile libs/port/Makefile libs/unicode/Makefile libs/uuid/Makefile libs/wine/Makefile libs/wpp/Makefile loader/Makefile programs/Makefile programs/avitools/Makefile programs/clock/Makefile 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 programs/uninstaller/Makefile programs/view/Makefile programs/wcmd/Makefile programs/wineboot/Makefile programs/winecfg/Makefile programs/wineconsole/Makefile programs/winedbg/Makefile programs/winefile/Makefile programs/winemenubuilder/Makefile programs/winemine/Makefile programs/winepath/Makefile programs/winevdm/Makefile programs/winhelp/Makefile programs/winver/Makefile server/Makefile tools/Makefile tools/widl/Makefile tools/winapi/Makefile tools/winebuild/Makefile tools/winedump/Makefile tools/winegcc/Makefile tools/wmc/Makefile tools/wrc/Makefile" + ac_config_files="$ac_config_files Make.rules dlls/Makedll.rules dlls/Maketest.rules libs/Makelib.rules programs/Makeprog.rules Makefile dlls/Makefile dlls/advapi32/Makefile dlls/advapi32/tests/Makefile dlls/avicap32/Makefile dlls/avifil32/Makefile dlls/cabinet/Makefile dlls/capi2032/Makefile dlls/cfgmgr32/Makefile dlls/comcat/Makefile dlls/comctl32/Makefile dlls/comctl32/tests/Makefile dlls/commdlg/Makefile dlls/crtdll/Makefile dlls/crypt32/Makefile dlls/ctl3d/Makefile dlls/wined3d/Makefile dlls/d3d8/Makefile dlls/d3d9/Makefile dlls/d3dim/Makefile dlls/d3dx8/Makefile dlls/dciman32/Makefile dlls/ddraw/Makefile dlls/ddraw/tests/Makefile dlls/devenum/Makefile dlls/dinput/Makefile dlls/dinput8/Makefile dlls/dmband/Makefile dlls/dmcompos/Makefile dlls/dmime/Makefile dlls/dmloader/Makefile dlls/dmscript/Makefile dlls/dmstyle/Makefile dlls/dmsynth/Makefile dlls/dmusic/Makefile dlls/dmusic32/Makefile dlls/dplay/Makefile dlls/dplayx/Makefile dlls/dpnhpast/Makefile dlls/dsound/Makefile dlls/dsound/tests/Makefile dlls/gdi/Makefile dlls/gdi/tests/Makefile dlls/glu32/Makefile dlls/icmp/Makefile dlls/imagehlp/Makefile dlls/imm32/Makefile dlls/iphlpapi/Makefile dlls/kernel/Makefile dlls/kernel/tests/Makefile dlls/lzexpand/Makefile dlls/mapi32/Makefile dlls/mpr/Makefile dlls/msacm/Makefile dlls/msacm/imaadp32/Makefile dlls/msacm/msadp32/Makefile dlls/msacm/msg711/Makefile dlls/msacm/winemp3/Makefile dlls/msdmo/Makefile dlls/mshtml/Makefile dlls/msi/Makefile dlls/msimg32/Makefile dlls/msisys/Makefile dlls/msnet32/Makefile dlls/msvcrt/Makefile dlls/msvcrt/tests/Makefile dlls/msvcrt20/Makefile dlls/msvcrtd/Makefile dlls/msvideo/Makefile dlls/msvideo/msrle32/Makefile dlls/mswsock/Makefile dlls/netapi32/Makefile dlls/netapi32/tests/Makefile dlls/ntdll/Makefile dlls/ntdll/tests/Makefile dlls/odbc32/Makefile dlls/ole32/Makefile dlls/oleacc/Makefile dlls/oleaut32/Makefile dlls/oleaut32/tests/Makefile dlls/olecli/Makefile dlls/oledlg/Makefile dlls/olepro32/Makefile dlls/olesvr/Makefile dlls/opengl32/Makefile dlls/psapi/Makefile dlls/qcap/Makefile dlls/quartz/Makefile dlls/rasapi32/Makefile dlls/richedit/Makefile dlls/rpcrt4/Makefile dlls/rpcrt4/tests/Makefile dlls/serialui/Makefile dlls/setupapi/Makefile dlls/shdocvw/Makefile dlls/shell32/Makefile dlls/shell32/tests/Makefile dlls/shfolder/Makefile dlls/shlwapi/Makefile dlls/shlwapi/tests/Makefile dlls/snmpapi/Makefile dlls/sti/Makefile dlls/tapi32/Makefile dlls/ttydrv/Makefile dlls/twain/Makefile dlls/unicows/Makefile dlls/url/Makefile dlls/urlmon/Makefile dlls/urlmon/tests/Makefile dlls/user/Makefile dlls/user/tests/Makefile dlls/uxtheme/Makefile dlls/version/Makefile dlls/win32s/Makefile dlls/winaspi/Makefile dlls/winedos/Makefile dlls/wineps/Makefile dlls/wininet/Makefile dlls/wininet/tests/Makefile dlls/winmm/Makefile dlls/winmm/joystick/Makefile dlls/winmm/mcianim/Makefile dlls/winmm/mciavi/Makefile dlls/winmm/mcicda/Makefile dlls/winmm/mciseq/Makefile dlls/winmm/mciwave/Makefile dlls/winmm/midimap/Makefile dlls/winmm/tests/Makefile dlls/winmm/wavemap/Makefile dlls/winmm/winealsa/Makefile dlls/winmm/winearts/Makefile dlls/winmm/wineaudioio/Makefile dlls/winmm/winenas/Makefile dlls/winmm/winejack/Makefile dlls/winmm/wineoss/Makefile dlls/winnls/Makefile dlls/winsock/Makefile dlls/winsock/tests/Makefile dlls/winspool/Makefile dlls/winspool/tests/Makefile dlls/wintab32/Makefile dlls/wintrust/Makefile dlls/wow32/Makefile dlls/wsock32/Makefile dlls/x11drv/Makefile documentation/Makefile include/Makefile libs/Makefile libs/port/Makefile libs/unicode/Makefile libs/uuid/Makefile libs/wine/Makefile libs/wpp/Makefile loader/Makefile programs/Makefile programs/avitools/Makefile programs/clock/Makefile programs/cmdlgtst/Makefile programs/control/Makefile programs/expand/Makefile programs/notepad/Makefile programs/progman/Makefile programs/regedit/Makefile programs/regsvr32/Makefile programs/rpcss/Makefile programs/rundll32/Makefile programs/start/Makefile programs/uninstaller/Makefile programs/view/Makefile programs/wcmd/Makefile programs/wineboot/Makefile programs/winecfg/Makefile programs/wineconsole/Makefile programs/winedbg/Makefile programs/winefile/Makefile programs/winemenubuilder/Makefile programs/winemine/Makefile programs/winepath/Makefile programs/winevdm/Makefile programs/winhelp/Makefile programs/winver/Makefile server/Makefile tools/Makefile tools/widl/Makefile tools/winapi/Makefile tools/winebuild/Makefile tools/winedump/Makefile tools/winegcc/Makefile tools/wmc/Makefile tools/wrc/Makefile" cat >confcache <<\_ACEOF @@ -17913,12 +17911,9 @@ do "programs/control/Makefile" ) CONFIG_FILES="$CONFIG_FILES programs/control/Makefile" ;; "programs/expand/Makefile" ) CONFIG_FILES="$CONFIG_FILES programs/expand/Makefile" ;; "programs/notepad/Makefile" ) CONFIG_FILES="$CONFIG_FILES programs/notepad/Makefile" ;; - "programs/osversioncheck/Makefile" ) CONFIG_FILES="$CONFIG_FILES programs/osversioncheck/Makefile" ;; "programs/progman/Makefile" ) CONFIG_FILES="$CONFIG_FILES programs/progman/Makefile" ;; - "programs/regapi/Makefile" ) CONFIG_FILES="$CONFIG_FILES programs/regapi/Makefile" ;; "programs/regedit/Makefile" ) CONFIG_FILES="$CONFIG_FILES programs/regedit/Makefile" ;; "programs/regsvr32/Makefile" ) CONFIG_FILES="$CONFIG_FILES programs/regsvr32/Makefile" ;; - "programs/regtest/Makefile" ) CONFIG_FILES="$CONFIG_FILES programs/regtest/Makefile" ;; "programs/rpcss/Makefile" ) CONFIG_FILES="$CONFIG_FILES programs/rpcss/Makefile" ;; "programs/rundll32/Makefile" ) CONFIG_FILES="$CONFIG_FILES programs/rundll32/Makefile" ;; "programs/start/Makefile" ) CONFIG_FILES="$CONFIG_FILES programs/start/Makefile" ;; @@ -17967,7 +17962,6 @@ do "include/wine" ) CONFIG_COMMANDS="$CONFIG_COMMANDS include/wine" ;; "misc" ) CONFIG_COMMANDS="$CONFIG_COMMANDS misc" ;; "objects" ) CONFIG_COMMANDS="$CONFIG_COMMANDS objects" ;; - "programs/regapi/tests" ) CONFIG_COMMANDS="$CONFIG_COMMANDS programs/regapi/tests" ;; "programs/regedit/tests" ) CONFIG_COMMANDS="$CONFIG_COMMANDS programs/regedit/tests" ;; "windows" ) CONFIG_COMMANDS="$CONFIG_COMMANDS windows" ;; "include/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/config.h" ;; @@ -18695,8 +18689,6 @@ echo "$as_me: creating include/wine" >&6;} && mkdir "include/wine") ;; echo "$as_me: creating misc" >&6;} && mkdir "misc") ;; objects ) test -d "objects" || ({ echo "$as_me:$LINENO: creating objects" >&5 echo "$as_me: creating objects" >&6;} && mkdir "objects") ;; - programs/regapi/tests ) test -d "programs/regapi/tests" || ({ echo "$as_me:$LINENO: creating programs/regapi/tests" >&5 -echo "$as_me: creating programs/regapi/tests" >&6;} && mkdir "programs/regapi/tests") ;; programs/regedit/tests ) test -d "programs/regedit/tests" || ({ echo "$as_me:$LINENO: creating programs/regedit/tests" >&5 echo "$as_me: creating programs/regedit/tests" >&6;} && mkdir "programs/regedit/tests") ;; windows ) test -d "windows" || ({ echo "$as_me:$LINENO: creating windows" >&5 diff --git a/configure.ac b/configure.ac index 5568db9f77a..c1b553bb7a2 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/programs/Makefile.in b/programs/Makefile.in index 8f31bfcce35..904755ca0aa 100644 --- a/programs/Makefile.in +++ b/programs/Makefile.in @@ -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 \ diff --git a/programs/osversioncheck/.cvsignore b/programs/osversioncheck/.cvsignore deleted file mode 100644 index 3e7c3442b8d..00000000000 --- a/programs/osversioncheck/.cvsignore +++ /dev/null @@ -1,3 +0,0 @@ -Makefile -osversioncheck.exe.dbg.c -osversioncheck.exe.spec.c diff --git a/programs/osversioncheck/Makefile.in b/programs/osversioncheck/Makefile.in deleted file mode 100644 index 737cea30f2a..00000000000 --- a/programs/osversioncheck/Makefile.in +++ /dev/null @@ -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: diff --git a/programs/osversioncheck/osversioncheck.c b/programs/osversioncheck/osversioncheck.c deleted file mode 100644 index 9092f5c5698..00000000000 --- a/programs/osversioncheck/osversioncheck.c +++ /dev/null @@ -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 - * - * - * 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 -#include -#include - -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; -} diff --git a/programs/regapi/.cvsignore b/programs/regapi/.cvsignore deleted file mode 100644 index 27c462859c3..00000000000 --- a/programs/regapi/.cvsignore +++ /dev/null @@ -1,3 +0,0 @@ -Makefile -regapi.exe.dbg.c -regapi.exe.spec.c diff --git a/programs/regapi/Makefile.in b/programs/regapi/Makefile.in deleted file mode 100644 index f4e819925b9..00000000000 --- a/programs/regapi/Makefile.in +++ /dev/null @@ -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: diff --git a/programs/regapi/README b/programs/regapi/README deleted file mode 100644 index 13b122f6bbd..00000000000 --- a/programs/regapi/README +++ /dev/null @@ -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. diff --git a/programs/regapi/regFixer.pl b/programs/regapi/regFixer.pl deleted file mode 100755 index 5d4aa07a578..00000000000 --- a/programs/regapi/regFixer.pl +++ /dev/null @@ -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"; -} diff --git a/programs/regapi/regRestorer.pl b/programs/regapi/regRestorer.pl deleted file mode 100755 index 0fbe3a1b0fb..00000000000 --- a/programs/regapi/regRestorer.pl +++ /dev/null @@ -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" - } -} diff --git a/programs/regapi/regSet.sh b/programs/regapi/regSet.sh deleted file mode 100755 index 717357291e9..00000000000 --- a/programs/regapi/regSet.sh +++ /dev/null @@ -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 diff --git a/programs/regapi/regapi.c b/programs/regapi/regapi.c deleted file mode 100644 index 9abaa3c50ea..00000000000 --- a/programs/regapi/regapi.c +++ /dev/null @@ -1,1106 +0,0 @@ -/* - * Command line Registry implementation - * - * 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 - * - * Note: Please consult the README file for more information. - * - */ - -#include -#include -#include -#include -#include -#include -#include - -/****************************************************************************** - * Defines and consts - */ -#define IDENTICAL 0 -#define COMMAND_COUNT 7 - -#define KEY_MAX_LEN 1024 -#define STDIN_MAX_LEN 102400 - -/* Return values */ -#define COMMAND_NOT_FOUND -1 -#define SUCCESS 0 -#define NOT_ENOUGH_MEMORY 1 -#define KEY_VALUE_ALREADY_SET 2 -#define COMMAND_NOT_SUPPORTED 3 - -/* Generic global */ -static BOOL bForce = FALSE; /* Is set to TRUE when -force is - passed on the command line */ - -/* Globals used by the api setValue, queryValue */ -static LPSTR currentKeyName = NULL; -static HKEY currentKeyClass = 0; -static HKEY currentKeyHandle = 0; -static BOOL bTheKeyIsOpen = FALSE; - -/* Delimiters used to parse the "value"="data" pair for setValue*/ -#define SET_VALUE_MAX_ARGS 2 -/* Delimiters used to parse the "value" to query queryValue*/ -#define QUERY_VALUE_MAX_ARGS 1 - -static const char *setValueDelim[SET_VALUE_MAX_ARGS] = {"=", ""}; -static const char *queryValueDelim[QUERY_VALUE_MAX_ARGS] = {""}; - - -/* - * Forward declaration - */ -typedef void (*commandAPI)(LPSTR lpsLine); - -static void doSetValue(LPSTR lpsLine); -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); - -/* - * Currently supported api - */ -static const char* commandNames[COMMAND_COUNT] = { - "setValue", - "deleteValue", - "createKey", - "deleteKey", - "queryValue", - "registerDLL", - "unregisterDLL" -}; - -/* - * Pointers to processing entry points - */ -static const commandAPI commandAPIs[COMMAND_COUNT] = { - doSetValue, - doDeleteValue, - doCreateKey, - doDeleteKey, - doQueryValue, - doRegisterDLL, - doUnregisterDLL -}; - -/* - * Generic prototypes - */ -static DWORD getDataType(LPSTR *lpValue, DWORD* parse_type); -static LPSTR getRegKeyName(LPSTR lpLine); -static HKEY getRegClass(LPSTR lpLine); -static LPSTR getArg(LPSTR arg); -static INT getCommand(LPSTR commandName); -static DWORD convertHexToDWord(char *str, BYTE *buf); -static DWORD convertHexCSVToHex(char *str, BYTE *buf, ULONG bufLen); -static LPSTR convertHexToHexCSV( BYTE *buf, ULONG len); -static LPSTR convertHexToDWORDStr( BYTE *buf, ULONG len); -static HRESULT openKey(LPSTR stdInput); -static void closeKey(); - -/* - * api setValue prototypes - */ -static void processSetValue(LPSTR cmdline); -static HRESULT setValue(LPSTR *argv); - -/* - * api queryValue prototypes - */ -static void processQueryValue(LPSTR cmdline); - -/* - * Help Text displayed when invalid parameters are provided - */ -static char helpText[] = -"NAME\n" -" regapi - perform certain actions on the wine registry.\n" -"\n" -"SYNOPSIS\n" -" regapi commandName [-force] < file\n" -"\n" -"DESCRIPTION\n" -" regapi modifies settings in the wine registry. It processes\n" -" the given commandName for every line in the stdin data stream.\n" -" Input data format may vary depending on the commandName\n" -" (see INPUT FILE FORMAT).\n" -"\n" -"OPTIONS\n" -" commandName\n" -" Instruct regapi about what action to perform on the data stream.\n" -" Currently, only setValue and queryValue are supported and\n" -" implemented.\n" -"\n" -" -force\n" -" When provided the action will be performed anyway. This may\n" -" have a different meaning depending on the context. For example,\n" -" when providing -force to setValue, the value is set even if it\n" -" was previously set to another value.\n" -"\n" -" < file\n" -" STDIN channel, provide a file name with line of the appropriate\n" -" format.\n" -"\n" -"INPUT FILE FORMAT\n" -"\n" -" setValue\n" -" The input file is in format, obtained from regedit.exe export.\n" -"\n" -" [KEY_CLASS\\Some\\Path\\For\\A\\Key]\n" -" \"Value1\"=\"Data1\"\n" -" \"Value2\"=\"Data2\"\n" -" \"Valuen\"=\"Datan\"\n" -" ...\n" -"\n" -" queryValue\n" -" The input file format required by the queryValue command is\n" -" similar to the one required by setValue. The only\n" -" difference is that you only provide the value name.\n" -"\n" -" [KEY_CLASS\\Some\\Path\\For\\A\\Key]\n" -" \"Value1\"\n" -" \"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" -; - - -/****************************************************************************** - * This function returns the HKEY associated with the data type encoded in the - * value. It modifies the input parameter (key value) in order to skip this - * "now useless" data type information. - * - * Note: Updated based on the algorithm used in 'server/registry.c' - */ -DWORD getDataType(LPSTR *lpValue, DWORD* parse_type) -{ - struct data_type { const char *tag; int len; int type; int parse_type; }; - - static const struct data_type data_types[] = - { /* actual type */ /* type to assume for parsing */ - { "\"", 1, REG_SZ, REG_SZ }, - { "str:\"", 5, REG_SZ, REG_SZ }, - { "str(2):\"", 8, REG_EXPAND_SZ, REG_SZ }, - { "str(7):\"", 8, REG_MULTI_SZ, REG_SZ }, - { "hex:", 4, REG_BINARY, REG_BINARY }, - { "dword:", 6, REG_DWORD, REG_DWORD }, - { "hex(", 4, -1, REG_BINARY }, - { NULL, 0, 0, 0 } - }; - - const struct data_type *ptr; - int type; - - for (ptr = data_types; ptr->tag; ptr++) - { - if (memcmp( ptr->tag, *lpValue, ptr->len )) - continue; - - /* Found! */ - *parse_type = ptr->parse_type; - type=ptr->type; - *lpValue+=ptr->len; - if (type == -1) { - char* end; - /* "hex(xx):" is special */ - *lpValue += 4; - type = (int)strtoul( *lpValue , &end, 16 ); - if (**lpValue=='\0' || *end!=')' || *(end+1)!=':') { - type=REG_NONE; - } else { - *lpValue=end+2; - } - } - return type; - } - return (**lpValue=='\0'?REG_SZ:REG_NONE); -} - -/****************************************************************************** - * Extracts from a [HKEY\some\key\path] type of line the key name (what starts - * after the first '\' and end before the ']' - */ -LPSTR getRegKeyName(LPSTR lpLine) -{ - LPSTR keyNameBeg = NULL; - LPSTR keyNameEnd = NULL; - char lpLineCopy[KEY_MAX_LEN]; - - if (lpLine == NULL) - return NULL; - - strcpy(lpLineCopy, 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 = '\0'; /* Isolate the key name */ - - currentKeyName = HeapAlloc(GetProcessHeap(), 0, strlen(keyNameBeg)+1); - if (currentKeyName != NULL) - strcpy(currentKeyName, keyNameBeg); - - return currentKeyName; -} - -/****************************************************************************** - * Extracts from a [HKEY/some/key/path] type of line the key class (what - * starts after the '[' and ends before the first '\' - */ -static HKEY getRegClass(LPSTR lpClass) -{ - LPSTR classNameEnd; - LPSTR classNameBeg; - - char lpClassCopy[KEY_MAX_LEN]; - - if (lpClass == NULL) - return (HKEY)ERROR_INVALID_PARAMETER; - - strcpy(lpClassCopy, lpClass); - - classNameEnd = strstr(lpClassCopy, "\\"); /* The class name end by '\' */ - *classNameEnd = '\0'; /* Isolate the class name */ - classNameBeg = &lpClassCopy[1]; /* Skip the '[' */ - - if (strcmp( classNameBeg, "HKEY_LOCAL_MACHINE") == IDENTICAL ) - return HKEY_LOCAL_MACHINE; - else if (strcmp( classNameBeg, "HKEY_USERS") == IDENTICAL ) - return HKEY_USERS; - else if (strcmp( classNameBeg, "HKEY_CLASSES_ROOT") == IDENTICAL ) - return HKEY_CLASSES_ROOT; - else if (strcmp( classNameBeg, "HKEY_CURRENT_CONFIG") == IDENTICAL ) - return HKEY_CURRENT_CONFIG; - else if (strcmp( classNameBeg, "HKEY_CURRENT_USER") == IDENTICAL ) - return HKEY_CURRENT_USER; - else - return (HKEY)ERROR_INVALID_PARAMETER; -} - -/****************************************************************************** - * This is a replacement for strsep which is not portable (missing on Solaris). - */ -static char* getToken(char** str, const char* delims) -{ - char* token; - - if (*str==NULL) { - /* No more tokens */ - return NULL; - } - - token=*str; - while (**str!='\0') { - if (strchr(delims,**str)!=NULL) { - **str='\0'; - (*str)++; - return token; - } - (*str)++; - } - /* There is no other token */ - *str=NULL; - return token; -} - -/****************************************************************************** - * Returns an allocated buffer with a cleaned copy (removed the surrounding - * dbl quotes) of the passed value. - */ -static LPSTR getArg( LPSTR arg) -{ - LPSTR tmp = NULL; - ULONG len; - - if (arg == NULL) - return NULL; - - /* - * Get rid of surrounding quotes - */ - len = strlen(arg); - - if( arg[len-1] == '\"' ) arg[len-1] = '\0'; - if( arg[0] == '\"' ) arg++; - - tmp = HeapAlloc(GetProcessHeap(), 0, strlen(arg)+1); - strcpy(tmp, arg); - - return tmp; -} - -/****************************************************************************** - * Returns the index in the commands array of the command to process. - */ -static INT getCommand(LPSTR commandName) -{ - INT count; - for (count=0; count < COMMAND_COUNT; count++) - if ( strcmp(commandName, commandNames[count]) == IDENTICAL) - return count; - - return COMMAND_NOT_FOUND; -} - -/****************************************************************************** - * Converts a hex representation of a DWORD into a DWORD. - */ -static DWORD convertHexToDWord(char *str, BYTE *buf) -{ - DWORD dw; - char xbuf[9]; - - memcpy(xbuf,str,8); - xbuf[8]='\0'; - sscanf(xbuf,"%08lx",&dw); - memcpy(buf,&dw,sizeof(DWORD)); - return sizeof(DWORD); -} - -/****************************************************************************** - * Converts a hex buffer into a hex comma separated values - */ -static char* convertHexToHexCSV(BYTE *buf, ULONG bufLen) -{ - char* str; - char* ptrStr; - BYTE* ptrBuf; - - ULONG current = 0; - - str = HeapAlloc(GetProcessHeap(), 0, (bufLen+1)*2); - memset(str, 0, (bufLen+1)*2); - ptrStr = str; /* Pointer to result */ - ptrBuf = buf; /* Pointer to current */ - - while (current < bufLen) - { - BYTE bCur = ptrBuf[current++]; - char res[3]; - - sprintf(res, "%02x", (unsigned int)*&bCur); - strcat(str, res); - strcat(str, ","); - } - - /* Get rid of the last comma */ - str[strlen(str)-1] = '\0'; - return str; -} - -/****************************************************************************** - * Converts a hex buffer into a DWORD string - */ -static char* convertHexToDWORDStr(BYTE *buf, ULONG bufLen) -{ - char* str; - DWORD dw; - - if ( bufLen != sizeof(DWORD) ) return NULL; - - str = HeapAlloc(GetProcessHeap(), 0, (bufLen*2)+1); - - memcpy(&dw,buf,sizeof(DWORD)); - sprintf(str, "%08lx", dw); - - /* Get rid of the last comma */ - return str; -} -/****************************************************************************** - * Converts a hex comma separated values list into a hex list. - */ -static DWORD convertHexCSVToHex(char *str, BYTE *buf, ULONG bufLen) -{ - char *s = str; /* Pointer to current */ - char *b = buf; /* Pointer to result */ - - ULONG strLen = strlen(str); - ULONG strPos = 0; - DWORD byteCount = 0; - - memset(buf, 0, bufLen); - - /* - * warn the user if we are here with a string longer than 2 bytes that does - * 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 comma, " - "input data seems invalid.\n"); - - while (strPos < strLen) - { - char xbuf[3]; - char wc; - - memcpy(xbuf,s,2); xbuf[3]='\0'; - sscanf(xbuf,"%02x",(UINT*)&wc); - *b++ =(unsigned char)wc; - - s+=3; - strPos+=3; - byteCount++; - } - - return byteCount; -} - - -/****************************************************************************** - * Sets the value in argv[0] to the data in argv[1] for the currently - * opened key. - */ -static HRESULT setValue(LPSTR *argv) -{ - HRESULT hRes; - DWORD dwSize = KEY_MAX_LEN; - DWORD dwType = 0; - DWORD dwDataType,dwParseType; - - LPSTR lpsCurrentValue; - - LPSTR keyValue = getArg(argv[0]); - LPSTR keyData = argv[1]; - - /* Make some checks */ - 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. - */ - if( (keyValue[0] == '@') && (strlen(keyValue) == 1) ) - keyValue[0] = '\0'; - - /* Get the data type stored into the value field */ - dwDataType = getDataType(&keyData,&dwParseType); - - memset(lpsCurrentValue, 0, KEY_MAX_LEN); - hRes = RegQueryValueExA( - currentKeyHandle, - keyValue, - NULL, - &dwType, - (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 */ - { - LPBYTE lpbData; - BYTE convert[KEY_MAX_LEN]; - DWORD dwLen; - - if ( dwParseType == REG_SZ) /* no conversion for string */ - { - dwLen = strlen(keyData); - if (dwLen>0 && keyData[dwLen-1]=='"') - { - dwLen--; - keyData[dwLen]='\0'; - } - lpbData = keyData; - } - else if (dwParseType == REG_DWORD) /* Convert the dword types */ - { - dwLen = convertHexToDWord(keyData, convert); - lpbData = convert; - } - else /* Convert the hexadecimal types */ - { - dwLen = convertHexCSVToHex(keyData, convert, KEY_MAX_LEN); - lpbData = convert; - } - - hRes = RegSetValueEx( - currentKeyHandle, - keyValue, - 0, /* Reserved */ - dwDataType, - lpbData, - dwLen); - } - else - { - /* return the current value data into argv[1] */ - if (argv[1] != NULL) - { - HeapFree(GetProcessHeap(), 0, argv[1]); - argv[1] = HeapAlloc(GetProcessHeap(), 0, dwSize+1); - - if ( argv[1] != NULL ) { - strncpy(argv[1], lpsCurrentValue, dwSize); - argv[1][dwSize]='\0'; - } - } - - hRes=KEY_VALUE_ALREADY_SET; - } - if (keyValue != NULL) - HeapFree(GetProcessHeap(), 0, keyValue); - return hRes; -} - - -/****************************************************************************** - * Open the key - */ -static HRESULT openKey( LPSTR stdInput) -{ - DWORD dwDisp; - HRESULT hRes; - - /* Sanity checks */ - if (stdInput == NULL) - return ERROR_INVALID_PARAMETER; - - /* Get the registry class */ - currentKeyClass = getRegClass(stdInput); /* Sets global variable */ - if (currentKeyClass == (HKEY)ERROR_INVALID_PARAMETER) - return (HRESULT)ERROR_INVALID_PARAMETER; - - /* Get the key name */ - currentKeyName = getRegKeyName(stdInput); /* Sets global variable */ - if (currentKeyName == NULL) - return ERROR_INVALID_PARAMETER; - - hRes = RegCreateKeyEx( - currentKeyClass, /* Class */ - currentKeyName, /* Sub Key */ - 0, /* MUST BE 0 */ - NULL, /* object type */ - REG_OPTION_NON_VOLATILE, /* option, REG_OPTION_NON_VOLATILE ... */ - KEY_ALL_ACCESS, /* access mask, KEY_ALL_ACCESS */ - NULL, /* security attribute */ - ¤tKeyHandle, /* result */ - &dwDisp); /* disposition, REG_CREATED_NEW_KEY or - REG_OPENED_EXISTING_KEY */ - - if (hRes == ERROR_SUCCESS) - bTheKeyIsOpen = TRUE; - - return hRes; - -} -/****************************************************************************** - * This function is a wrapper for the setValue function. It prepares the - * land and clean the area once completed. - */ -static void processSetValue(LPSTR cmdline) -{ - LPSTR argv[SET_VALUE_MAX_ARGS]; /* args storage */ - - LPSTR token = NULL; /* current token analyzed */ - ULONG argCounter = 0; /* counter of args */ - INT counter; - HRESULT hRes = 0; - - /* - * Init storage and parse the line - */ - for (counter=0; counter currentSize){ - - stdInput=HeapReAlloc(GetProcessHeap(),0,stdInput,strlen(stdInput)+STDIN_MAX_LEN); - - currentSize+=STDIN_MAX_LEN; - } - - strcat(stdInput,nextLine+2); - } - - } - - /* - * We process every line, even the NULL (last) line, to indicate the - * end of the processing to the specific process. - */ - commandAPIs[cmdIndex](stdInput); - - if (stdInput == NULL) /* EOF encountered */ - break; - } - -#if 0 - /* - * Save the registry only if it was modified - */ - if ( commandSaveRegistry[cmdIndex] != FALSE ) - SHELL_SaveRegistry(); -#endif - HeapFree(GetProcessHeap(), 0, nextLine); - - HeapFree(GetProcessHeap(), 0, stdInput); - - return SUCCESS; -} diff --git a/programs/regapi/tests/.cvsignore b/programs/regapi/tests/.cvsignore deleted file mode 100644 index 48dcef97e6d..00000000000 --- a/programs/regapi/tests/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -regapi.ok diff --git a/programs/regapi/tests/README b/programs/regapi/tests/README deleted file mode 100644 index d5b65d0c5f8..00000000000 --- a/programs/regapi/tests/README +++ /dev/null @@ -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. diff --git a/programs/regapi/tests/after.reg b/programs/regapi/tests/after.reg deleted file mode 100644 index d6b9ade4e50..00000000000 --- a/programs/regapi/tests/after.reg +++ /dev/null @@ -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" - diff --git a/programs/regapi/tests/before.reg b/programs/regapi/tests/before.reg deleted file mode 100644 index 3eff0d3cd7e..00000000000 --- a/programs/regapi/tests/before.reg +++ /dev/null @@ -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" - diff --git a/programs/regapi/tests/orig.reg b/programs/regapi/tests/orig.reg deleted file mode 100644 index 0295d4350e1..00000000000 --- a/programs/regapi/tests/orig.reg +++ /dev/null @@ -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] diff --git a/programs/regapi/tests/regapi.pl b/programs/regapi/tests/regapi.pl deleted file mode 100644 index b572fbd8583..00000000000 --- a/programs/regapi/tests/regapi.pl +++ /dev/null @@ -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(); -} diff --git a/programs/regtest/.cvsignore b/programs/regtest/.cvsignore deleted file mode 100644 index a727e8f8cc3..00000000000 --- a/programs/regtest/.cvsignore +++ /dev/null @@ -1,3 +0,0 @@ -Makefile -regtest.exe.dbg.c -regtest.exe.spec.c diff --git a/programs/regtest/Makefile.in b/programs/regtest/Makefile.in deleted file mode 100644 index 6fd8c2b3da4..00000000000 --- a/programs/regtest/Makefile.in +++ /dev/null @@ -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: diff --git a/programs/regtest/regtest.c b/programs/regtest/regtest.c deleted file mode 100644 index d112208e2c3..00000000000 --- a/programs/regtest/regtest.c +++ /dev/null @@ -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 -#include -#include -#include -#include -#include - -#ifndef __GNUC__ -#define __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; -} diff --git a/tools/make_debug b/tools/make_debug deleted file mode 100755 index cc83b29846d..00000000000 --- a/tools/make_debug +++ /dev/null @@ -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 = ; -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; -- 2.11.4.GIT