32#define VALUE_CMD _T("VV")
33#define VALUE_CMD_LENGTH COMMAND_LENGTH(VALUE_CMD)
34#define VALUE_CMD_SHORT_DESC VALUE_CMD _T(" command is used to view value.\n")
85 goto CheckValueArgument;
91 blnBadParameter =
FALSE;
100 blnUnicodeDump =
TRUE;
102 else if ((*pchParameter ==
_T(
'/'))&&(*(pchParameter+1) ==
_T(
'f')))
104 pchFilename = pchParameter+2;
106 else if (!pchValueFull)
108 pchValueFull = pchParameter;
112 blnBadParameter =
TRUE;
116 rConsole.
Write(
_T(
"Bad parameter: "));
117 rConsole.
Write(pchParameter);
124 const TCHAR *pszEmpty =
_T(
"");
125 const TCHAR *pszPath;
140 goto ValueCommandNAonRoot;
143 pchValueName = pchSep?(pchSep+1):(pchValueFull);
144 pszPath = pchSep?pchValueFull:
_T(
".");
157 pchValueName = (
TCHAR*)pszEmpty;
164 goto SkipValueCommand;
168 goto ValueCommandNAonRoot;
171 rConsole.
Write(
_T(
"Value name : \""));
176 (*pchValueName ==
_T(
'\"'))&&
177 (pchValueName[
l-1] ==
_T(
'\"')))
179 pchValueName[
l-1] = 0;
182 rConsole.
Write(pchValueName);
185 nError =
Key.GetValue(pchValueName,
NULL,
NULL,&dwValueSize);
188 pDataBuffer =
new BYTE [dwValueSize];
189 Key.GetValue(pchValueName,&dwType,pDataBuffer,&dwValueSize);
190 rConsole.
Write(
_T(
"Value type : "));
192 rConsole.
Write(
_T(
"\nValue data : "));
199 for (
unsigned int i = 0 ;
i < dwValueSize ;
i++)
211 for (
unsigned int i = 0 ;
i < dwValueSize ;
i++)
223 TCHAR *pchCurrentString = (
TCHAR *)pDataBuffer;
225 while(*pchCurrentString)
228 rConsole.
Write(pchCurrentString);
230 pchCurrentString +=
_tcslen(pchCurrentString)+1;
247 for (
i = 0 ;
i < dwValueSize ;
i++)
262 unsigned int n = *(pDataBuffer+
i);
266 if (
i && (
i%16 == 15))
269 for (
j =
i-15;
j <=
i;
j += blnUnicodeDump?2:1)\
271 if ((
j%8 == 0)&&(
j%16 != 0))
280 wchar_t ch = *(
TCHAR *)(pDataBuffer+
j);
294 unsigned char ch = *(pDataBuffer+
j);
321 if (
k && (
k%16 == 15))
324 for (
j =
k-15;
j <
i;
j += blnUnicodeDump?2:1)
326 if (blnUnicodeDump&&(
j+1 >=
i))
331 if ((
j%8 == 0)&&(
j%16 != 0))
340 wchar_t ch = *(
TCHAR *)(pDataBuffer+
j);
354 unsigned char ch = *(pDataBuffer+
j);
377 rConsole.
Write(
_T(
"Exporting value data to "));
378 rConsole.
Write(pchFilename);
384 rConsole.
Write(
_T(
"Cannot create new file "));
385 rConsole.
Write(pchFilename);
387 goto SkipValueCommand;
390 DWORD dwBytesWritten;
393 rConsole.
Write(
_T(
"Error writing file.\n"));
395 goto SkipValueCommand;
398 ASSERT(dwBytesWritten == dwValueSize);
410 rConsole.
Write(
_T(
"(System cannot find the value specified)\n"));
417 delete[] pDataBuffer;
427 _T(
"Syntax: ")
VALUE_CMD _T(
" [<PATH>][<VALUE_NAME>] [/u] [/?]\n\n")
428 _T(
" <PATH> - Optional relative path of key which value will be processed.\n")
429 _T(
" <VALUE_NAME> - Name of key's value. Default is key's default value.\n")
430 _T(
" /u - On binary dump view as Unicode.\n")
431 _T(
" /fFILE - Export value data to FILE.\n")
432 _T(
" /? - This help.\n\n")
433 _T(
"Without parameters, command displays default value of current key.\n");
#define COMMAND_NA_ON_ROOT
#define VALUE_CMD_SHORT_DESC
void ResetArgumentIteration()
TCHAR * GetNextArgument()
BOOL Write(const TCHAR *p, DWORD dwChars=0)
static const TCHAR * GetValueTypeName(DWORD dwType)
BOOL GetKey(const TCHAR *pchRelativePath, REGSAM DesiredAccess, CRegistryKey &rKey)
const TCHAR * GetLastErrorDescription()
virtual const TCHAR * GetHelpString()
virtual const TCHAR * GetHelpShortDescriptionString()
virtual ~CShellCommandValue()
virtual int Execute(CConsole &rConsole, CArgumentParser &rArguments)
CShellCommandValue(CRegistryTree &rTree)
virtual BOOL Match(const TCHAR *pchCommand)
#define INVALID_HANDLE_VALUE
#define FILE_ATTRIBUTE_NORMAL
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
_CRTIMP char *__cdecl _itoa(_In_ int _Value, _Pre_notnull_ _Post_z_ char *_Dest, _In_ int _Radix)
#define ERROR_FILE_NOT_FOUND
#define REG_DWORD_LITTLE_ENDIAN
#define REG_DWORD_BIG_ENDIAN
#define REG_RESOURCE_LIST