no message

svn path=/trunk/; revision=1507
This commit is contained in:
Nedko Arnaudov 2001-01-13 23:55:37 +00:00
parent 15491f14dd
commit bf1b057da3
51 changed files with 320 additions and 197 deletions

View file

@ -1,8 +1,8 @@
/* $Id: ArgumentParser.cpp,v 1.3 2001/01/10 01:25:29 narnaoud Exp $ /* $Id: ArgumentParser.cpp,v 1.4 2001/01/13 23:53:46 narnaoud Exp $
* *
* regexpl - Console Registry Explorer * regexpl - Console Registry Explorer
* *
* Copyright (C) 2000 Nedko Arnaoudov <nedkohome@atia.com> * Copyright (C) 2000,2001 Nedko Arnaoudov <nedkohome@atia.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,3 +1,5 @@
/* $Id: ArgumentParser.h,v 1.2 2001/01/13 23:53:46 narnaoud Exp $ */
// ArgumentParser.h: interface for the CArgumentParser class. // ArgumentParser.h: interface for the CArgumentParser class.
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////

View file

@ -1,8 +1,8 @@
/* $Id: Completion.cpp,v 1.1 2001/01/10 01:25:29 narnaoud Exp $ /* $Id: Completion.cpp,v 1.2 2001/01/13 23:54:07 narnaoud Exp $
* *
* regexpl - Console Registry Explorer * regexpl - Console Registry Explorer
* *
* Copyright (C) 2000 Nedko Arnaoudov <nedkohome@atia.com> * Copyright (C) 2000,2001 Nedko Arnaoudov <nedkohome@atia.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -240,10 +240,10 @@ BOOL CCompletionList::Add(const TCHAR *pszText, BOOL blnIsKey)
const TCHAR * CCompletionList::Get(unsigned __int64 nIndex, BOOL& rblnIsKey) const TCHAR * CCompletionList::Get(unsigned __int64 nIndex, BOOL& rblnIsKey)
{ {
ASSERT(nIndex < m_nCount); ASSERT(nIndex < m_nCount);
BOOL blnForward; BOOL blnForward = FALSE;
CCompletionMatch *pNode = NULL; CCompletionMatch *pNode = NULL;
unsigned __int64 nRelativeIndex; unsigned __int64 nRelativeIndex = 0;
if (m_pLastSearched) if (m_pLastSearched)
{ {

View file

@ -1,9 +1,9 @@
/* $Id: Completion.h,v 1.1 2001/01/10 01:25:29 narnaoud Exp $ */ /* $Id: Completion.h,v 1.2 2001/01/13 23:54:07 narnaoud Exp $ */
// Completion.h - declaration for completion related functions // Completion.h - declaration for completion related functions
#if !defined(PATTERN_H__INCLUDED_) #if !defined(COMLPETION_H__INCLUDED_)
#define PATTERN_H__INCLUDED_ #define COMPLETION_H__INCLUDED_
typedef const TCHAR * (*ReplaceCompletionCallback)(unsigned __int64& rnIndex, const BOOL *pblnForward, typedef const TCHAR * (*ReplaceCompletionCallback)(unsigned __int64& rnIndex, const BOOL *pblnForward,
const TCHAR *pchContext, const TCHAR *pchBegin); const TCHAR *pchContext, const TCHAR *pchBegin);

View file

@ -1,8 +1,8 @@
/* $Id: Console.cpp,v 1.3 2001/01/10 01:25:29 narnaoud Exp $ /* $Id: Console.cpp,v 1.4 2001/01/13 23:54:07 narnaoud Exp $
* *
* regexpl - Console Registry Explorer * regexpl - Console Registry Explorer
* *
* Copyright (C) 2000 Nedko Arnaoudov <nedkohome@atia.com> * Copyright (C) 2000,2001 Nedko Arnaoudov <nedkohome@atia.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,3 +1,5 @@
/* $Id: Console.h,v 1.4 2001/01/13 23:54:07 narnaoud Exp $ */
// Console.h: interface for the CConsole class. // Console.h: interface for the CConsole class.
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////

View file

@ -1,8 +1,8 @@
/* $Id: Pattern.cpp,v 1.1 2001/01/10 01:25:29 narnaoud Exp $ /* $Id: Pattern.cpp,v 1.2 2001/01/13 23:54:40 narnaoud Exp $
* *
* regexpl - Console Registry Explorer * regexpl - Console Registry Explorer
* *
* Copyright (C) 2000 Nedko Arnaoudov <nedkohome@atia.com> * Copyright (C) 2000,2001 Nedko Arnaoudov <nedkohome@atia.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -32,6 +32,10 @@ BOOL PatternMatch(const TCHAR *pszPattern, const TCHAR *pszTry)
{ {
if (((*pszTry) == 0) && ((*pszPattern) == 0)) if (((*pszTry) == 0) && ((*pszPattern) == 0))
return TRUE; return TRUE;
if (((*pszTry) == 0) || ((*pszPattern) == 0))
return FALSE;
pszTry++; pszTry++;
pszPattern++; pszPattern++;
} }

View file

@ -1,8 +1,8 @@
/* $Id: RegistryExplorer.cpp,v 1.3 2001/01/10 01:25:29 narnaoud Exp $ /* $Id: RegistryExplorer.cpp,v 1.4 2001/01/13 23:54:40 narnaoud Exp $
* *
* regexpl - Console Registry Explorer * regexpl - Console Registry Explorer
* *
* Copyright (C) 2000 Nedko Arnaoudov <nedkohome@atia.com> * Copyright (C) 2000,2001 Nedko Arnaoudov <nedkohome@atia.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,8 +1,9 @@
/* $Id: RegistryExplorer.h,v 1.5 2001/01/13 23:53:23 narnaoud Exp $ */
#ifndef _REGISTRY_EXPLORER_H__INCLUDED #ifndef _REGISTRY_EXPLORER_H__INCLUDED
#define _REGISTRY_EXPLORER_H__INCLUDED #define _REGISTRY_EXPLORER_H__INCLUDED
#define CURRENT_VERSION _T("0.20") #define CURRENT_VERSION _T("0.20+")
#define EMAIL _T("registryexplorer@yahoo.com") #define EMAIL _T("registryexplorer@yahoo.com")
//#define __L(x) L ## x //#define __L(x) L ## x

View file

@ -1,8 +1,8 @@
/* $Id: RegistryKey.cpp,v 1.3 2001/01/10 01:25:29 narnaoud Exp $ /* $Id: RegistryKey.cpp,v 1.4 2001/01/13 23:54:40 narnaoud Exp $
* *
* regexpl - Console Registry Explorer * regexpl - Console Registry Explorer
* *
* Copyright (C) 2000 Nedko Arnaoudov <nedkohome@atia.com> * Copyright (C) 2000,2001 Nedko Arnaoudov <nedkohome@atia.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,3 +1,5 @@
/* $Id: RegistryKey.h,v 1.4 2001/01/13 23:54:41 narnaoud Exp $ */
// RegistryKey.h: interface for the CRegistryKey class. // RegistryKey.h: interface for the CRegistryKey class.
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////

View file

@ -1,8 +1,8 @@
/* $Id: RegistryTree.cpp,v 1.3 2001/01/10 01:25:29 narnaoud Exp $ /* $Id: RegistryTree.cpp,v 1.4 2001/01/13 23:54:41 narnaoud Exp $
* *
* regexpl - Console Registry Explorer * regexpl - Console Registry Explorer
* *
* Copyright (C) 2000 Nedko Arnaoudov <nedkohome@atia.com> * Copyright (C) 2000,2001 Nedko Arnaoudov <nedkohome@atia.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -286,6 +286,8 @@ BOOL CRegistryTree::DeleteSubkeys(CRegistryKey& rKey, const TCHAR *pszKeyPattern
rKey.InitSubkeyEnumeration(pszSubkeyName, dwMaxSubkeyNameLength); rKey.InitSubkeyEnumeration(pszSubkeyName, dwMaxSubkeyNameLength);
BOOL blnKeyDeleted = FALSE; BOOL blnKeyDeleted = FALSE;
while ((nError = rKey.GetNextSubkeyName()) == ERROR_SUCCESS) while ((nError = rKey.GetNextSubkeyName()) == ERROR_SUCCESS)
{
if (PatternMatch(pszKeyPattern,pszSubkeyName))
{ {
if (blnRecursive) if (blnRecursive)
{ // deltion is recursive, delete subkey subkeys { // deltion is recursive, delete subkey subkeys
@ -300,8 +302,6 @@ BOOL CRegistryTree::DeleteSubkeys(CRegistryKey& rKey, const TCHAR *pszKeyPattern
} }
} }
if (PatternMatch(pszKeyPattern,pszSubkeyName))
{
nError = rKey.DeleteSubkey(pszSubkeyName); nError = rKey.DeleteSubkey(pszSubkeyName);
if (nError != ERROR_SUCCESS) if (nError != ERROR_SUCCESS)
{ {
@ -311,6 +311,7 @@ BOOL CRegistryTree::DeleteSubkeys(CRegistryKey& rKey, const TCHAR *pszKeyPattern
return FALSE; return FALSE;
} }
blnKeyDeleted = TRUE; blnKeyDeleted = TRUE;
rKey.InitSubkeyEnumeration(pszSubkeyName, dwMaxSubkeyNameLength); // reset iteration
} }
} }

View file

@ -1,8 +1,8 @@
/* $Id: SecurityDescriptor.cpp,v 1.3 2001/01/10 01:25:29 narnaoud Exp $ /* $Id: SecurityDescriptor.cpp,v 1.4 2001/01/13 23:54:41 narnaoud Exp $
* *
* regexpl - Console Registry Explorer * regexpl - Console Registry Explorer
* *
* Copyright (C) 2000 Nedko Arnaoudov <nedkohome@atia.com> * Copyright (C) 2000,2001 Nedko Arnaoudov <nedkohome@atia.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,3 +1,5 @@
/* $Id: SecurityDescriptor.h,v 1.3 2001/01/13 23:54:41 narnaoud Exp $ */
// SecurityDescriptor.h: interface for the CSecurityDescriptor class. // SecurityDescriptor.h: interface for the CSecurityDescriptor class.
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////

View file

@ -1,8 +1,8 @@
/* $Id: ShellCommand.cpp,v 1.2 2000/10/24 20:17:41 narnaoud Exp $ /* $Id: ShellCommand.cpp,v 1.3 2001/01/13 23:55:36 narnaoud Exp $
* *
* regexpl - Console Registry Explorer * regexpl - Console Registry Explorer
* *
* Copyright (C) 2000 Nedko Arnaoudov <nedkohome@atia.com> * Copyright (C) 2000,2001 Nedko Arnaoudov <nedkohome@atia.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,3 +1,5 @@
/* $Id: ShellCommand.h,v 1.2 2001/01/13 23:55:36 narnaoud Exp $ */
// ShellCommand.h: interface for the CShellCommand class. // ShellCommand.h: interface for the CShellCommand class.
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////

View file

@ -1,8 +1,8 @@
/* $Id: ShellCommandChangeKey.cpp,v 1.3 2001/01/10 01:25:29 narnaoud Exp $ /* $Id: ShellCommandChangeKey.cpp,v 1.4 2001/01/13 23:55:36 narnaoud Exp $
* *
* regexpl - Console Registry Explorer * regexpl - Console Registry Explorer
* *
* Copyright (C) 2000 Nedko Arnaoudov <nedkohome@atia.com> * Copyright (C) 2000,2001 Nedko Arnaoudov <nedkohome@atia.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,3 +1,5 @@
/* $Id: ShellCommandChangeKey.h,v 1.2 2001/01/13 23:55:36 narnaoud Exp $ */
// ShellCommandChangeKey.h: interface for the CShellCommandChangeKey class. // ShellCommandChangeKey.h: interface for the CShellCommandChangeKey class.
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////

View file

@ -1,8 +1,8 @@
/* $Id: ShellCommandConnect.cpp,v 1.3 2001/01/10 01:25:29 narnaoud Exp $ /* $Id: ShellCommandConnect.cpp,v 1.4 2001/01/13 23:55:36 narnaoud Exp $
* *
* regexpl - Console Registry Explorer * regexpl - Console Registry Explorer
* *
* Copyright (C) 2000 Nedko Arnaoudov <nedkohome@atia.com> * Copyright (C) 2000,2001 Nedko Arnaoudov <nedkohome@atia.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,3 +1,5 @@
/* $Id: ShellCommandConnect.h,v 1.2 2001/01/13 23:55:36 narnaoud Exp $ */
// ShellCommandConnect.h: interface for the CShellCommandConnect class. // ShellCommandConnect.h: interface for the CShellCommandConnect class.
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////

View file

@ -1,8 +1,8 @@
/* $Id: ShellCommandDACL.cpp,v 1.3 2001/01/10 01:25:29 narnaoud Exp $ /* $Id: ShellCommandDACL.cpp,v 1.4 2001/01/13 23:55:36 narnaoud Exp $
* *
* regexpl - Console Registry Explorer * regexpl - Console Registry Explorer
* *
* Copyright (C) 2000 Nedko Arnaoudov <nedkohome@atia.com> * Copyright (C) 2000,2001 Nedko Arnaoudov <nedkohome@atia.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,3 +1,5 @@
/* $Id: ShellCommandDACL.h,v 1.2 2001/01/13 23:55:37 narnaoud Exp $ */
// ShellCommandDACL.h: interface for the CShellCommandDACL class. // ShellCommandDACL.h: interface for the CShellCommandDACL class.
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////

View file

@ -1,8 +1,8 @@
/* $Id: ShellCommandDOKA.cpp,v 1.2 2000/10/24 20:17:41 narnaoud Exp $ /* $Id: ShellCommandDOKA.cpp,v 1.3 2001/01/13 23:55:37 narnaoud Exp $
* *
* regexpl - Console Registry Explorer * regexpl - Console Registry Explorer
* *
* Copyright (C) 2000 Nedko Arnaoudov <nedkohome@atia.com> * Copyright (C) 2000,2001 Nedko Arnaoudov <nedkohome@atia.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,3 +1,5 @@
/* $Id: ShellCommandDOKA.h,v 1.2 2001/01/13 23:55:37 narnaoud Exp $ */
// ShellCommandDOKA.h: interface for the CShellCommandDOKA class. // ShellCommandDOKA.h: interface for the CShellCommandDOKA class.
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////

View file

@ -1,8 +1,8 @@
/* $Id: ShellCommandDeleteKey.cpp,v 1.3 2001/01/10 01:25:29 narnaoud Exp $ /* $Id: ShellCommandDeleteKey.cpp,v 1.4 2001/01/13 23:55:37 narnaoud Exp $
* *
* regexpl - Console Registry Explorer * regexpl - Console Registry Explorer
* *
* Copyright (C) 2000 Nedko Arnaoudov <nedkohome@atia.com> * Copyright (C) 2000,2001 Nedko Arnaoudov <nedkohome@atia.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -116,7 +116,10 @@ int CShellCommandDeleteKey::Execute(CConsole &rConsole, CArgumentParser& rArgume
ASSERT(pch >= pchKey); ASSERT(pch >= pchKey);
const TCHAR *pszPath; const TCHAR *pszPath;
TCHAR *pszPattern = pch+1; TCHAR *pszPattern = pch;
if (*pch == _T('\\'))
pszPattern++;
if (pch == pchKey) if (pch == pchKey)
{ {
pszPath = _T("."); pszPath = _T(".");

View file

@ -1,3 +1,5 @@
/* $Id: ShellCommandDeleteKey.h,v 1.2 2001/01/13 23:55:37 narnaoud Exp $ */
// ShellCommandDeleteKey.h: interface for the CShellCommandDeleteKey class. // ShellCommandDeleteKey.h: interface for the CShellCommandDeleteKey class.
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////

View file

@ -1,8 +1,8 @@
/* $Id: ShellCommandDeleteValue.cpp,v 1.3 2001/01/10 01:25:29 narnaoud Exp $ /* $Id: ShellCommandDeleteValue.cpp,v 1.4 2001/01/13 23:55:37 narnaoud Exp $
* *
* regexpl - Console Registry Explorer * regexpl - Console Registry Explorer
* *
* Copyright (C) 2000 Nedko Arnaoudov <nedkohome@atia.com> * Copyright (C) 2000,2001 Nedko Arnaoudov <nedkohome@atia.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -27,6 +27,7 @@
#include "ph.h" #include "ph.h"
#include "ShellCommandDeleteValue.h" #include "ShellCommandDeleteValue.h"
#include "RegistryExplorer.h" #include "RegistryExplorer.h"
#include "Pattern.h"
#define DV_CMD _T("DV") #define DV_CMD _T("DV")
#define DV_CMD_LENGTH COMMAND_LENGTH(DV_CMD) #define DV_CMD_LENGTH COMMAND_LENGTH(DV_CMD)
@ -57,7 +58,6 @@ int CShellCommandDeleteValue::Execute(CConsole &rConsole, CArgumentParser& rArgu
TCHAR *pszParameter; TCHAR *pszParameter;
TCHAR *pszValueFull = NULL; TCHAR *pszValueFull = NULL;
BOOL blnHelp = FALSE; BOOL blnHelp = FALSE;
// DWORD dwError;
if ((_tcsnicmp(pszCommandItself,DV_CMD _T(".."),DV_CMD_LENGTH+2*sizeof(TCHAR)) == 0)|| if ((_tcsnicmp(pszCommandItself,DV_CMD _T(".."),DV_CMD_LENGTH+2*sizeof(TCHAR)) == 0)||
(_tcsnicmp(pszCommandItself,DV_CMD _T("\\"),DV_CMD_LENGTH+1*sizeof(TCHAR)) == 0)) (_tcsnicmp(pszCommandItself,DV_CMD _T("\\"),DV_CMD_LENGTH+1*sizeof(TCHAR)) == 0))
@ -92,7 +92,7 @@ CheckValueArgument:
} }
CRegistryKey Key; CRegistryKey Key;
TCHAR *pszValueName; TCHAR *pszValueNamePattern;
const TCHAR *pszPath; const TCHAR *pszPath;
if (blnHelp) if (blnHelp)
@ -107,45 +107,61 @@ CheckValueArgument:
goto CommandNAonRoot; goto CommandNAonRoot;
TCHAR *pchSep = _tcsrchr(pszValueFull,_T('\\')); TCHAR *pchSep = _tcsrchr(pszValueFull,_T('\\'));
pszValueName = pchSep?(pchSep+1):(pszValueFull); pszValueNamePattern = pchSep?(pchSep+1):(pszValueFull);
pszPath = pchSep?pszValueFull:_T("."); pszPath = pchSep?pszValueFull:_T(".");
//if (_tcsrchr(pszValueName,_T('.')))
//{
// pszValueName = _T("");
// pszPath = pszValueFull;
//}
//else
if (pchSep) if (pchSep)
*pchSep = 0; *pchSep = 0;
} }
else else
{ {
pszValueName = _T(""); pszValueNamePattern = _T("");
pszPath = _T("."); pszPath = _T(".");
} }
{ {
size_t s = _tcslen(pszValueName); size_t s = _tcslen(pszValueNamePattern);
if (s && (pszValueName[0] == _T('\"'))&&(pszValueName[s-1] == _T('\"'))) if (s && (pszValueNamePattern[0] == _T('\"'))&&(pszValueNamePattern[s-1] == _T('\"')))
{ {
pszValueName[s-1] = 0; pszValueNamePattern[s-1] = 0;
pszValueName++; pszValueNamePattern++;
} }
} }
if (!m_rTree.GetKey(pszPath,KEY_SET_VALUE,Key)) if (!m_rTree.GetKey(pszPath,KEY_QUERY_VALUE|KEY_SET_VALUE,Key))
{ {
rConsole.Write(m_rTree.GetLastErrorDescription()); rConsole.Write(m_rTree.GetLastErrorDescription());
goto SkipCommand; return 0;
} }
if (!Key.IsRoot()) if (!Key.IsRoot())
{ // not root key ??? { // not root key ???
LONG nError = Key.DeleteValue(pszValueName); TCHAR Buffer[254];
DWORD dwMaxValueNameLength;
LONG nError = Key.GetMaxValueNameLength(dwMaxValueNameLength);
if (nError != ERROR_SUCCESS)
{
_stprintf(Buffer,_T("Cannot query info about %s key. Error is %u\n"),Key.GetKeyName(),(unsigned int)nError);
rConsole.Write(Buffer);
return 0;
}
TCHAR *pszValueName = new TCHAR[dwMaxValueNameLength];
if (!pszValueName)
{
rConsole.Write("Out of memory.");
return 0;
}
Key.InitValueEnumeration(pszValueName,dwMaxValueNameLength,NULL,0,NULL);
while ((nError = Key.GetNextValue()) == ERROR_SUCCESS)
{
if (PatternMatch(pszValueNamePattern,pszValueName))
{
nError = Key.DeleteValue(pszValueName);
if (nError != ERROR_SUCCESS) if (nError != ERROR_SUCCESS)
{ {
char Buffer[254];
_stprintf(Buffer,_T("Cannot delete value. Error is %u\n"),(unsigned int)nError); _stprintf(Buffer,_T("Cannot delete value. Error is %u\n"),(unsigned int)nError);
rConsole.Write(Buffer); rConsole.Write(Buffer);
} }
@ -153,6 +169,9 @@ CheckValueArgument:
{ {
InvalidateCompletion(); InvalidateCompletion();
} }
Key.InitValueEnumeration(pszValueName,dwMaxValueNameLength,NULL,0,NULL); // reset iteration
}
}
} // if (pKey) } // if (pKey)
else else
{ {
@ -160,9 +179,6 @@ CommandNAonRoot:
rConsole.Write(DV_CMD COMMAND_NA_ON_ROOT); rConsole.Write(DV_CMD COMMAND_NA_ON_ROOT);
} }
SkipCommand:
// if (pTree)
// delete pTree;
return 0; return 0;
} }
@ -171,7 +187,7 @@ const TCHAR * CShellCommandDeleteValue::GetHelpString()
return DV_CMD_SHORT_DESC return DV_CMD_SHORT_DESC
_T("Syntax: ") DV_CMD _T(" [<PATH>][<VALUE_NAME>] [/?]\n\n") _T("Syntax: ") DV_CMD _T(" [<PATH>][<VALUE_NAME>] [/?]\n\n")
_T(" <PATH> - Optional relative path of key which value will be delete.\n") _T(" <PATH> - Optional relative path of key which value will be delete.\n")
_T(" <VALUE_NAME> - Name of key's value. Default is key's default value.\n") _T(" <VALUE_NAME> - Name pattern of key's value. Default is key's default value.\n")
_T(" /? - This help.\n\n"); _T(" /? - This help.\n\n");
} }

View file

@ -1,3 +1,5 @@
/* $Id: ShellCommandDeleteValue.h,v 1.2 2001/01/13 23:55:37 narnaoud Exp $ */
// ShellCommandDeleteValue.h: interface for the CShellCommandDeleteValue class. // ShellCommandDeleteValue.h: interface for the CShellCommandDeleteValue class.
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////

View file

@ -1,8 +1,8 @@
/* $Id: ShellCommandDir.cpp,v 1.3 2001/01/10 01:25:29 narnaoud Exp $ /* $Id: ShellCommandDir.cpp,v 1.4 2001/01/13 23:55:37 narnaoud Exp $
* *
* regexpl - Console Registry Explorer * regexpl - Console Registry Explorer
* *
* Copyright (C) 2000 Nedko Arnaoudov <nedkohome@atia.com> * Copyright (C) 2000,2001 Nedko Arnaoudov <nedkohome@atia.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -29,6 +29,7 @@
#include "ShellCommandDir.h" #include "ShellCommandDir.h"
#include "RegistryTree.h" #include "RegistryTree.h"
#include "RegistryKey.h" #include "RegistryKey.h"
#include "Pattern.h"
// *** THIS SHOULD GO IN A MINGW/ROS HEADER (tchar.h ???) - Begin // *** THIS SHOULD GO IN A MINGW/ROS HEADER (tchar.h ???) - Begin
#if 1 // #ifndef _ui64tot ??? #if 1 // #ifndef _ui64tot ???
@ -74,9 +75,9 @@ int CShellCommandDir::Execute(CConsole &rConsole, CArgumentParser& rArguments)
rArguments.ResetArgumentIteration(); rArguments.ResetArgumentIteration();
BOOL blnDo = TRUE,blnBadParameter, blnHelp = FALSE; BOOL blnDo = TRUE,blnBadParameter, blnHelp = FALSE;
const TCHAR *pszParameter; TCHAR *pszParameter;
const TCHAR *pszCommandItself = rArguments.GetNextArgument(); TCHAR *pszCommandItself = rArguments.GetNextArgument();
const TCHAR *pszKey = NULL; TCHAR *pszKey = NULL;
if ((_tcsnicmp(pszCommandItself,DIR_CMD _T(".."),DIR_CMD_LENGTH+2*sizeof(TCHAR)) == 0)|| if ((_tcsnicmp(pszCommandItself,DIR_CMD _T(".."),DIR_CMD_LENGTH+2*sizeof(TCHAR)) == 0)||
(_tcsnicmp(pszCommandItself,DIR_CMD _T("\\"),DIR_CMD_LENGTH+1*sizeof(TCHAR)) == 0)) (_tcsnicmp(pszCommandItself,DIR_CMD _T("\\"),DIR_CMD_LENGTH+1*sizeof(TCHAR)) == 0))
@ -116,9 +117,50 @@ CheckDirArgument:
} }
} }
const TCHAR *pszPattern = PATTERN_MATCH_ALL;
const TCHAR *pszPath = _T(".");
if (pszKey)
{
pszPath = pszKey;
TCHAR *pch = pszKey;
while(*pch) // search end of string
pch++;
if (pch > pszKey) // last non-null char
pch--;
if (*pch != _T('\\'))
{
while ((pch > pszKey) && (*pch != _T('\\')))
pch--;
if (*pch == _T('\\'))
{
pszPattern = pch+1;
if (pch > pszKey)
{
ASSERT(*pch == _T('\\'));
*pch = 0;
}
else if (*pch == _T('\\'))
{
pszPath = _T("\\");
}
}
else
{
pszPattern = pszKey;
pszPath = _T(".");
}
}
}
CRegistryKey Key; CRegistryKey Key;
if (!m_rTree.GetKey(pszKey?pszKey:_T("."),KEY_ENUMERATE_SUB_KEYS|KEY_QUERY_VALUE,Key)) if (!m_rTree.GetKey(pszPath,KEY_ENUMERATE_SUB_KEYS|KEY_QUERY_VALUE,Key))
{ {
const TCHAR *pszErrorMsg = m_rTree.GetLastErrorDescription(); const TCHAR *pszErrorMsg = m_rTree.GetLastErrorDescription();
rConsole.Write(pszErrorMsg); rConsole.Write(pszErrorMsg);
@ -164,12 +206,15 @@ CheckDirArgument:
Key.InitSubkeyEnumeration(pszSubkeyNameBuffer,dwMaxSubkeyNameLength); Key.InitSubkeyEnumeration(pszSubkeyNameBuffer,dwMaxSubkeyNameLength);
while ((nError = Key.GetNextSubkeyName()) == ERROR_SUCCESS) while ((nError = Key.GetNextSubkeyName()) == ERROR_SUCCESS)
{
if (PatternMatch(pszPattern,pszSubkeyNameBuffer))
{ {
rConsole.Write(_T("\t(KEY)\t\t\t\t")); rConsole.Write(_T("\t(KEY)\t\t\t\t"));
rConsole.Write(pszSubkeyNameBuffer); rConsole.Write(pszSubkeyNameBuffer);
rConsole.Write(_T("\\\n")); rConsole.Write(_T("\\\n"));
nTotalItems++; nTotalItems++;
} }
}
delete pszSubkeyNameBuffer; delete pszSubkeyNameBuffer;
@ -198,6 +243,8 @@ CheckDirArgument:
unsigned int nTabSize = rConsole.GetTabWidth(); unsigned int nTabSize = rConsole.GetTabWidth();
unsigned int nTabs; unsigned int nTabs;
while((nError = Key.GetNextValue(&dwValueNameActualLength)) == ERROR_SUCCESS) while((nError = Key.GetNextValue(&dwValueNameActualLength)) == ERROR_SUCCESS)
{
if (PatternMatch(pszPattern,pchValueNameBuffer))
{ {
rConsole.Write(_T("\t")); rConsole.Write(_T("\t"));
pszValueTypeName = CRegistryKey::GetValueTypeName(Type); pszValueTypeName = CRegistryKey::GetValueTypeName(Type);
@ -210,6 +257,7 @@ CheckDirArgument:
rConsole.Write(_T("\n")); rConsole.Write(_T("\n"));
nTotalItems++; nTotalItems++;
} }
}
delete pchValueNameBuffer; delete pchValueNameBuffer;
@ -236,8 +284,9 @@ CheckDirArgument:
const TCHAR * CShellCommandDir::GetHelpString() const TCHAR * CShellCommandDir::GetHelpString()
{ {
return DIR_CMD_SHORT_DESC return DIR_CMD_SHORT_DESC
_T("Syntax: ") DIR_CMD _T(" [<KEY>] [/?]\n\n") _T("Syntax: ") DIR_CMD _T(" [<PATH>\\][<PATTERN>] [/?]\n\n")
_T(" <KEY> - Optional relative path to the key on which command will be executed\n") _T(" <PATH> - Optional relative path to the key on which command will be executed\n")
_T(" <PATTERN> - Optional pattern. Default is the all matching pattern.")
_T(" /? - This help.\n\n") _T(" /? - This help.\n\n")
_T("Without parameters, command lists keys and values of current key.\n"); _T("Without parameters, command lists keys and values of current key.\n");
} }

View file

@ -1,3 +1,5 @@
/* $Id: ShellCommandDir.h,v 1.2 2001/01/13 23:55:37 narnaoud Exp $ */
// ShellCommandDir.h: interface for the CShellCommandDir class. // ShellCommandDir.h: interface for the CShellCommandDir class.
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////

View file

@ -1,8 +1,8 @@
/* $Id: ShellCommandExit.cpp,v 1.2 2000/10/24 20:17:41 narnaoud Exp $ /* $Id: ShellCommandExit.cpp,v 1.3 2001/01/13 23:55:37 narnaoud Exp $
* *
* regexpl - Console Registry Explorer * regexpl - Console Registry Explorer
* *
* Copyright (C) 2000 Nedko Arnaoudov <nedkohome@atia.com> * Copyright (C) 2000,2001 Nedko Arnaoudov <nedkohome@atia.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,3 +1,5 @@
/* $Id: ShellCommandExit.h,v 1.2 2001/01/13 23:55:37 narnaoud Exp $ */
// ShellCommandExit.h: interface for the CShellCommandExit class. // ShellCommandExit.h: interface for the CShellCommandExit class.
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////

View file

@ -1,8 +1,8 @@
/* $Id: ShellCommandHelp.cpp,v 1.3 2001/01/10 01:25:29 narnaoud Exp $ /* $Id: ShellCommandHelp.cpp,v 1.4 2001/01/13 23:55:37 narnaoud Exp $
* *
* regexpl - Console Registry Explorer * regexpl - Console Registry Explorer
* *
* Copyright (C) 2000 Nedko Arnaoudov <nedkohome@atia.com> * Copyright (C) 2000,2001 Nedko Arnaoudov <nedkohome@atia.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,3 +1,5 @@
/* $Id: ShellCommandHelp.h,v 1.2 2001/01/13 23:55:37 narnaoud Exp $ */
// ShellCommandHelp.h: interface for the CShellCommandHelp class. // ShellCommandHelp.h: interface for the CShellCommandHelp class.
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////

View file

@ -1,8 +1,8 @@
/* $Id: ShellCommandNewKey.cpp,v 1.3 2001/01/10 01:25:29 narnaoud Exp $ /* $Id: ShellCommandNewKey.cpp,v 1.4 2001/01/13 23:55:37 narnaoud Exp $
* *
* regexpl - Console Registry Explorer * regexpl - Console Registry Explorer
* *
* Copyright (C) 2000 Nedko Arnaoudov <nedkohome@atia.com> * Copyright (C) 2000,2001 Nedko Arnaoudov <nedkohome@atia.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -116,7 +116,10 @@ int CShellCommandNewKey::Execute(CConsole &rConsole, CArgumentParser& rArguments
ASSERT(pch >= pszNewKey); ASSERT(pch >= pszNewKey);
const TCHAR *pszPath; const TCHAR *pszPath;
TCHAR *pszSubkeyName = pch+1; TCHAR *pszSubkeyName = pch;
if (*pch == _T('\\'))
pszSubkeyName++;
if (pch == pszNewKey) if (pch == pszNewKey)
{ {
pszPath = _T("."); pszPath = _T(".");

View file

@ -1,3 +1,5 @@
/* $Id: ShellCommandNewKey.h,v 1.2 2001/01/13 23:55:37 narnaoud Exp $ */
// ShellCommandNewKey.h: interface for the CShellCommandNewKey class. // ShellCommandNewKey.h: interface for the CShellCommandNewKey class.
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////

View file

@ -1,8 +1,8 @@
/* $Id: ShellCommandOwner.cpp,v 1.3 2001/01/10 01:25:29 narnaoud Exp $ /* $Id: ShellCommandOwner.cpp,v 1.4 2001/01/13 23:55:37 narnaoud Exp $
* *
* regexpl - Console Registry Explorer * regexpl - Console Registry Explorer
* *
* Copyright (C) 2000 Nedko Arnaoudov <nedkohome@atia.com> * Copyright (C) 2000,2001 Nedko Arnaoudov <nedkohome@atia.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,3 +1,5 @@
/* $Id: ShellCommandOwner.h,v 1.2 2001/01/13 23:55:37 narnaoud Exp $ */
// ShellCommandOwner.h: interface for the CShellCommandOwner class. // ShellCommandOwner.h: interface for the CShellCommandOwner class.
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////

View file

@ -1,8 +1,8 @@
/* $Id: ShellCommandSACL.cpp,v 1.3 2001/01/10 01:25:29 narnaoud Exp $ /* $Id: ShellCommandSACL.cpp,v 1.4 2001/01/13 23:55:37 narnaoud Exp $
* *
* regexpl - Console Registry Explorer * regexpl - Console Registry Explorer
* *
* Copyright (C) 2000 Nedko Arnaoudov <nedkohome@atia.com> * Copyright (C) 2000,2001 Nedko Arnaoudov <nedkohome@atia.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,3 +1,5 @@
/* $Id: ShellCommandSACL.h,v 1.2 2001/01/13 23:55:37 narnaoud Exp $ */
// ShellCommandSACL.h: interface for the CShellCommandSACL class. // ShellCommandSACL.h: interface for the CShellCommandSACL class.
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////

View file

@ -1,8 +1,8 @@
/* $Id: ShellCommandSetValue.cpp,v 1.3 2001/01/10 01:25:29 narnaoud Exp $ /* $Id: ShellCommandSetValue.cpp,v 1.4 2001/01/13 23:55:37 narnaoud Exp $
* *
* regexpl - Console Registry Explorer * regexpl - Console Registry Explorer
* *
* Copyright (C) 2000 Nedko Arnaoudov <nedkohome@atia.com> * Copyright (C) 2000,2001 Nedko Arnaoudov <nedkohome@atia.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,3 +1,5 @@
/* $Id: ShellCommandSetValue.h,v 1.2 2001/01/13 23:55:37 narnaoud Exp $ */
// ShellCommandSetValue.h: interface for the CShellCommandSetValue class. // ShellCommandSetValue.h: interface for the CShellCommandSetValue class.
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////

View file

@ -1,8 +1,8 @@
/* $Id: ShellCommandValue.cpp,v 1.3 2001/01/10 01:25:29 narnaoud Exp $ /* $Id: ShellCommandValue.cpp,v 1.4 2001/01/13 23:55:37 narnaoud Exp $
* *
* regexpl - Console Registry Explorer * regexpl - Console Registry Explorer
* *
* Copyright (C) 2000 Nedko Arnaoudov <nedkohome@atia.com> * Copyright (C) 2000,2001 Nedko Arnaoudov <nedkohome@atia.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,3 +1,5 @@
/* $Id: ShellCommandValue.h,v 1.2 2001/01/13 23:55:37 narnaoud Exp $ */
// ShellCommandValue.h: interface for the CShellCommandValue class. // ShellCommandValue.h: interface for the CShellCommandValue class.
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////

View file

@ -1,8 +1,8 @@
/* $Id: ShellCommandVersion.cpp,v 1.2 2000/10/24 20:17:42 narnaoud Exp $ /* $Id: ShellCommandVersion.cpp,v 1.3 2001/01/13 23:55:37 narnaoud Exp $
* *
* regexpl - Console Registry Explorer * regexpl - Console Registry Explorer
* *
* Copyright (C) 2000 Nedko Arnaoudov <nedkohome@atia.com> * Copyright (C) 2000,2001 Nedko Arnaoudov <nedkohome@atia.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,3 +1,5 @@
/* $Id: ShellCommandVersion.h,v 1.2 2001/01/13 23:55:37 narnaoud Exp $ */
// ShellCommandVersion.h: interface for the CShellCommandVersion class. // ShellCommandVersion.h: interface for the CShellCommandVersion class.
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////

View file

@ -1,8 +1,8 @@
/* $Id: ShellCommandsLinkedList.cpp,v 1.2 2000/10/24 20:17:42 narnaoud Exp $ /* $Id: ShellCommandsLinkedList.cpp,v 1.3 2001/01/13 23:55:37 narnaoud Exp $
* *
* regexpl - Console Registry Explorer * regexpl - Console Registry Explorer
* *
* Copyright (C) 2000 Nedko Arnaoudov <nedkohome@atia.com> * Copyright (C) 2000,2001 Nedko Arnaoudov <nedkohome@atia.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,3 +1,5 @@
/* $Id: ShellCommandsLinkedList.h,v 1.2 2001/01/13 23:55:37 narnaoud Exp $ */
// ShellCommandsLinkedList.h: interface for the CShellCommandsLinkedList class. // ShellCommandsLinkedList.h: interface for the CShellCommandsLinkedList class.
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////

View file

@ -1,8 +1,8 @@
/* $Id: TextHistory.cpp,v 1.2 2000/10/24 20:17:42 narnaoud Exp $ /* $Id: TextHistory.cpp,v 1.3 2001/01/13 23:55:37 narnaoud Exp $
* *
* regexpl - Console Registry Explorer * regexpl - Console Registry Explorer
* *
* Copyright (C) 2000 Nedko Arnaoudov <nedkohome@atia.com> * Copyright (C) 2000,2001 Nedko Arnaoudov <nedkohome@atia.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,3 +1,5 @@
/* $Id: TextHistory.h,v 1.2 2001/01/13 23:55:37 narnaoud Exp $ */
// TextHistory.h: interface for the CTextHistory class. // TextHistory.h: interface for the CTextHistory class.
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////

View file

@ -1,3 +1,5 @@
/* $Id: ph.h,v 1.3 2001/01/13 23:54:40 narnaoud Exp $ */
// ph.h : include file for standard system include files, // ph.h : include file for standard system include files,
// or project specific include files that are used frequently, but // or project specific include files that are used frequently, but
// are changed infrequently // are changed infrequently