What's wrong with this function?

Hi!

I make a Win32 application and this application run in a Windows Vista 64
bits environment…
But in “RegDeleteValue” always cause “failed with error 2: The system cannot
find the file specified”

I run this application with UAC disabled and enabled… with administrator
account and common user… the same problem…

The function is:

void RegDeleteAnyValue( HKEY hKey, char *KeyName, char *ValueName )
{
HKEY hKeyControl = NULL;

try
{
if ( RegOpenKeyEx( hKey, KeyName, 0, KEY_ALL_ACCESS |
KEY_WOW64_64KEY, &hKeyControl ) == ERROR_SUCCESS )
{
int x = RegDeleteValue( hKeyControl, ValueName );

if ( x != ERROR_SUCCESS )
{
TCHAR szBuf[80];
LPVOID lpMsgBuf;
DWORD dw = x;

FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
dw,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR) &lpMsgBuf,
0, NULL );

wsprintf(szBuf,
“failed with error %d: %s”,
dw, lpMsgBuf);

MessageBox(NULL, szBuf, “Error”, MB_OK);

LocalFree(lpMsgBuf);
}
}
}
catch(…)
{
MessageBox( NULL, “Error”, “”, MB_OK );
}

REGCLOSEKEY( hKeyControl );
}

Thank you for any help

Does the same win32 application work on windows 2003 x64 or XP x64?

I suspect you are hitting some redirection problems: if I remember well the
access to some registry keys is redirected on x64 Windows when the
application is running into wow64, i.e. it’s a win32 application running on
top of windows x64.

Have a nice day
GV

----- Original Message -----
From: “MasvList”
To: “Windows System Software Devs Interest List”
Sent: Monday, June 25, 2007 3:07 PM
Subject: [ntdev] What’s wrong with this function?

> Hi!
>
> I make a Win32 application and this application run in a Windows Vista 64
> bits environment…
> But in “RegDeleteValue” always cause “failed with error 2: The system
> cannot find the file specified”
>
> I run this application with UAC disabled and enabled… with administrator
> account and common user… the same problem…
>
> The function is:
>
> void RegDeleteAnyValue( HKEY hKey, char *KeyName, char *ValueName )
> {
> HKEY hKeyControl = NULL;
>
> try
> {
> if ( RegOpenKeyEx( hKey, KeyName, 0, KEY_ALL_ACCESS |
> KEY_WOW64_64KEY, &hKeyControl ) == ERROR_SUCCESS )
> {
> int x = RegDeleteValue( hKeyControl, ValueName );
>
> if ( x != ERROR_SUCCESS )
> {
> TCHAR szBuf[80];
> LPVOID lpMsgBuf;
> DWORD dw = x;
>
> FormatMessage(
> FORMAT_MESSAGE_ALLOCATE_BUFFER |
> FORMAT_MESSAGE_FROM_SYSTEM,
> NULL,
> dw,
> MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
> (LPTSTR) &lpMsgBuf,
> 0, NULL );
>
> wsprintf(szBuf,
> “failed with error %d: %s”,
> dw, lpMsgBuf);
>
> MessageBox(NULL, szBuf, “Error”, MB_OK);
>
> LocalFree(lpMsgBuf);
> }
> }
> }
> catch(…)
> {
> MessageBox( NULL, “Error”, “”, MB_OK );
> }
>
> REGCLOSEKEY( hKeyControl );
> }
>
> Thank you for any help
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer

Hi!

I try use the flag KEY_WOW64_64KEY, flag KEY_WOW64_32KEY and dont use any
flag… and the error is the same…

This application works fine in Windows XP with SP2 (32 bits)… and I dont
test in anothers 64 bits OSs versions…

Thank you

----- Original Message -----
From: “Gianluca Varenni”
To: “Windows System Software Devs Interest List”
Sent: Monday, June 25, 2007 7:32 PM
Subject: Re: [ntdev] What’s wrong with this function?

> Does the same win32 application work on windows 2003 x64 or XP x64?
>
> I suspect you are hitting some redirection problems: if I remember well
> the access to some registry keys is redirected on x64 Windows when the
> application is running into wow64, i.e. it’s a win32 application running
> on top of windows x64.
>
> Have a nice day
> GV
>
>
> ----- Original Message -----
> From: “MasvList”
> To: “Windows System Software Devs Interest List”
> Sent: Monday, June 25, 2007 3:07 PM
> Subject: [ntdev] What’s wrong with this function?
>
>
>> Hi!
>>
>> I make a Win32 application and this application run in a Windows Vista 64
>> bits environment…
>> But in “RegDeleteValue” always cause “failed with error 2: The system
>> cannot find the file specified”
>>
>> I run this application with UAC disabled and enabled… with
>> administrator account and common user… the same problem…
>>
>> The function is:
>>
>> void RegDeleteAnyValue( HKEY hKey, char *KeyName, char *ValueName )
>> {
>> HKEY hKeyControl = NULL;
>>
>> try
>> {
>> if ( RegOpenKeyEx( hKey, KeyName, 0, KEY_ALL_ACCESS |
>> KEY_WOW64_64KEY, &hKeyControl ) == ERROR_SUCCESS )
>> {
>> int x = RegDeleteValue( hKeyControl, ValueName );
>>
>> if ( x != ERROR_SUCCESS )
>> {
>> TCHAR szBuf[80];
>> LPVOID lpMsgBuf;
>> DWORD dw = x;
>>
>> FormatMessage(
>> FORMAT_MESSAGE_ALLOCATE_BUFFER |
>> FORMAT_MESSAGE_FROM_SYSTEM,
>> NULL,
>> dw,
>> MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
>> (LPTSTR) &lpMsgBuf,
>> 0, NULL );
>>
>> wsprintf(szBuf,
>> “failed with error %d: %s”,
>> dw, lpMsgBuf);
>>
>> MessageBox(NULL, szBuf, “Error”, MB_OK);
>>
>> LocalFree(lpMsgBuf);
>> }
>> }
>> }
>> catch(…)
>> {
>> MessageBox( NULL, “Error”, “”, MB_OK );
>> }
>>
>> REGCLOSEKEY( hKeyControl );
>> }
>>
>> Thank you for any help
>>
>>
>> —
>> Questions? First check the Kernel Driver FAQ at
>> http://www.osronline.com/article.cfm?id=256
>>
>> To unsubscribe, visit the List Server section of OSR Online at
>> http://www.osronline.com/page.cfm?name=ListServer
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer

Which registry key are you trying to access?

Have a nice day
GV

----- Original Message -----
From: “Marcos Velasco - UOL”
To: “Windows System Software Devs Interest List”
Sent: Monday, June 25, 2007 3:37 PM
Subject: Re: [ntdev] What’s wrong with this function?

> Hi!
>
> I try use the flag KEY_WOW64_64KEY, flag KEY_WOW64_32KEY and dont use any
> flag… and the error is the same…
>
> This application works fine in Windows XP with SP2 (32 bits)… and I dont
> test in anothers 64 bits OSs versions…
>
> Thank you
>
>
> ----- Original Message -----
> From: “Gianluca Varenni”
> To: “Windows System Software Devs Interest List”
> Sent: Monday, June 25, 2007 7:32 PM
> Subject: Re: [ntdev] What’s wrong with this function?
>
>
>> Does the same win32 application work on windows 2003 x64 or XP x64?
>>
>> I suspect you are hitting some redirection problems: if I remember well
>> the access to some registry keys is redirected on x64 Windows when the
>> application is running into wow64, i.e. it’s a win32 application running
>> on top of windows x64.
>>
>> Have a nice day
>> GV
>>
>>
>> ----- Original Message -----
>> From: “MasvList”
>> To: “Windows System Software Devs Interest List”
>> Sent: Monday, June 25, 2007 3:07 PM
>> Subject: [ntdev] What’s wrong with this function?
>>
>>
>>> Hi!
>>>
>>> I make a Win32 application and this application run in a Windows Vista
>>> 64 bits environment…
>>> But in “RegDeleteValue” always cause “failed with error 2: The system
>>> cannot find the file specified”
>>>
>>> I run this application with UAC disabled and enabled… with
>>> administrator account and common user… the same problem…
>>>
>>> The function is:
>>>
>>> void RegDeleteAnyValue( HKEY hKey, char *KeyName, char *ValueName )
>>> {
>>> HKEY hKeyControl = NULL;
>>>
>>> try
>>> {
>>> if ( RegOpenKeyEx( hKey, KeyName, 0, KEY_ALL_ACCESS |
>>> KEY_WOW64_64KEY, &hKeyControl ) == ERROR_SUCCESS )
>>> {
>>> int x = RegDeleteValue( hKeyControl, ValueName );
>>>
>>> if ( x != ERROR_SUCCESS )
>>> {
>>> TCHAR szBuf[80];
>>> LPVOID lpMsgBuf;
>>> DWORD dw = x;
>>>
>>> FormatMessage(
>>> FORMAT_MESSAGE_ALLOCATE_BUFFER |
>>> FORMAT_MESSAGE_FROM_SYSTEM,
>>> NULL,
>>> dw,
>>> MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
>>> (LPTSTR) &lpMsgBuf,
>>> 0, NULL );
>>>
>>> wsprintf(szBuf,
>>> “failed with error %d: %s”,
>>> dw, lpMsgBuf);
>>>
>>> MessageBox(NULL, szBuf, “Error”, MB_OK);
>>>
>>> LocalFree(lpMsgBuf);
>>> }
>>> }
>>> }
>>> catch(…)
>>> {
>>> MessageBox( NULL, “Error”, “”, MB_OK );
>>> }
>>>
>>> REGCLOSEKEY( hKeyControl );
>>> }
>>>
>>> Thank you for any help
>>>
>>>
>>> —
>>> Questions? First check the Kernel Driver FAQ at
>>> http://www.osronline.com/article.cfm?id=256
>>>
>>> To unsubscribe, visit the List Server section of OSR Online at
>>> http://www.osronline.com/page.cfm?name=ListServer
>>
>>
>> —
>> Questions? First check the Kernel Driver FAQ at
>> http://www.osronline.com/article.cfm?id=256
>>
>> To unsubscribe, visit the List Server section of OSR Online at
>> http://www.osronline.com/page.cfm?name=ListServer
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer

MasvList wrote:

I make a Win32 application and this application run in a Windows Vista
64 bits environment…
But in “RegDeleteValue” always cause “failed with error 2: The system
cannot find the file specified”

I run this application with UAC disabled and enabled… with
administrator account and common user… the same problem…

The most likely answer is that the value name doesn’t exist. What key
and value are you trying to delete? And remember that you’re asking to
delete a value from the 64-bit view.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Hi!
Any registry key… the same problem…

In my last test, I try change user’s permissions… but the error
continue… with administrator user the same error… very strange

----- Original Message -----
From: “Gianluca Varenni”
To: “Windows System Software Devs Interest List”
Sent: Monday, June 25, 2007 7:51 PM
Subject: Re: [ntdev] What’s wrong with this function?

> Which registry key are you trying to access?
>
> Have a nice day
> GV
>
> ----- Original Message -----
> From: “Marcos Velasco - UOL”
> To: “Windows System Software Devs Interest List”
> Sent: Monday, June 25, 2007 3:37 PM
> Subject: Re: [ntdev] What’s wrong with this function?
>
>
>> Hi!
>>
>> I try use the flag KEY_WOW64_64KEY, flag KEY_WOW64_32KEY and dont use any
>> flag… and the error is the same…
>>
>> This application works fine in Windows XP with SP2 (32 bits)… and I
>> dont test in anothers 64 bits OSs versions…
>>
>> Thank you
>>
>>
>> ----- Original Message -----
>> From: “Gianluca Varenni”
>> To: “Windows System Software Devs Interest List”
>> Sent: Monday, June 25, 2007 7:32 PM
>> Subject: Re: [ntdev] What’s wrong with this function?
>>
>>
>>> Does the same win32 application work on windows 2003 x64 or XP x64?
>>>
>>> I suspect you are hitting some redirection problems: if I remember well
>>> the access to some registry keys is redirected on x64 Windows when the
>>> application is running into wow64, i.e. it’s a win32 application running
>>> on top of windows x64.
>>>
>>> Have a nice day
>>> GV
>>>
>>>
>>> ----- Original Message -----
>>> From: “MasvList”
>>> To: “Windows System Software Devs Interest List”
>>> Sent: Monday, June 25, 2007 3:07 PM
>>> Subject: [ntdev] What’s wrong with this function?
>>>
>>>
>>>> Hi!
>>>>
>>>> I make a Win32 application and this application run in a Windows Vista
>>>> 64 bits environment…
>>>> But in “RegDeleteValue” always cause “failed with error 2: The system
>>>> cannot find the file specified”
>>>>
>>>> I run this application with UAC disabled and enabled… with
>>>> administrator account and common user… the same problem…
>>>>
>>>> The function is:
>>>>
>>>> void RegDeleteAnyValue( HKEY hKey, char *KeyName, char *ValueName )
>>>> {
>>>> HKEY hKeyControl = NULL;
>>>>
>>>> try
>>>> {
>>>> if ( RegOpenKeyEx( hKey, KeyName, 0, KEY_ALL_ACCESS |
>>>> KEY_WOW64_64KEY, &hKeyControl ) == ERROR_SUCCESS )
>>>> {
>>>> int x = RegDeleteValue( hKeyControl, ValueName );
>>>>
>>>> if ( x != ERROR_SUCCESS )
>>>> {
>>>> TCHAR szBuf[80];
>>>> LPVOID lpMsgBuf;
>>>> DWORD dw = x;
>>>>
>>>> FormatMessage(
>>>> FORMAT_MESSAGE_ALLOCATE_BUFFER |
>>>> FORMAT_MESSAGE_FROM_SYSTEM,
>>>> NULL,
>>>> dw,
>>>> MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
>>>> (LPTSTR) &lpMsgBuf,
>>>> 0, NULL );
>>>>
>>>> wsprintf(szBuf,
>>>> “failed with error %d: %s”,
>>>> dw, lpMsgBuf);
>>>>
>>>> MessageBox(NULL, szBuf, “Error”, MB_OK);
>>>>
>>>> LocalFree(lpMsgBuf);
>>>> }
>>>> }
>>>> }
>>>> catch(…)
>>>> {
>>>> MessageBox( NULL, “Error”, “”, MB_OK );
>>>> }
>>>>
>>>> REGCLOSEKEY( hKeyControl );
>>>> }
>>>>
>>>> Thank you for any help
>>>>
>>>>
>>>> —
>>>> Questions? First check the Kernel Driver FAQ at
>>>> http://www.osronline.com/article.cfm?id=256
>>>>
>>>> To unsubscribe, visit the List Server section of OSR Online at
>>>> http://www.osronline.com/page.cfm?name=ListServer
>>>
>>>
>>> —
>>> Questions? First check the Kernel Driver FAQ at
>>> http://www.osronline.com/article.cfm?id=256
>>>
>>> To unsubscribe, visit the List Server section of OSR Online at
>>> http://www.osronline.com/page.cfm?name=ListServer
>>
>>
>> —
>> Questions? First check the Kernel Driver FAQ at
>> http://www.osronline.com/article.cfm?id=256
>>
>> To unsubscribe, visit the List Server section of OSR Online at
>> http://www.osronline.com/page.cfm?name=ListServer
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer

Hi !
I enumerate all necessary registry values… and I use KEY_WOW64_64KEY
flag…

In all values… nothing is deleted… all cause errors…

I make a test… I create manually a value… and I try delete with this
function… result = error…

----- Original Message -----
From: “Tim Roberts”
To: “Windows System Software Devs Interest List”
Sent: Monday, June 25, 2007 7:53 PM
Subject: Re: [ntdev] What’s wrong with this function?

> MasvList wrote:
>>
>> I make a Win32 application and this application run in a Windows Vista
>> 64 bits environment…
>> But in “RegDeleteValue” always cause “failed with error 2: The system
>> cannot find the file specified”
>>
>> I run this application with UAC disabled and enabled… with
>> administrator account and common user… the same problem…
>
> The most likely answer is that the value name doesn’t exist. What key
> and value are you trying to delete? And remember that you’re asking to
> delete a value from the 64-bit view.
>
> –
> Tim Roberts, xxxxx@probo.com
> Providenza & Boekelheide, Inc.
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer

Since you don’t dump or print ValueName (and I’m guessing this hasn’t been stepped through ina debugger, either), how do you know it really is what you think it is?

Given everything else you’re saying, I’d guess you didn’t pass it what you think you did.

MasvList wrote:

Hi !
I enumerate all necessary registry values… and I use KEY_WOW64_64KEY
flag…

In all values… nothing is deleted… all cause errors…

I make a test… I create manually a value… and I try delete with
this function… result = error…

Please, show us a COMPLETE test case, including the code you use to call
your function. There’s nothing wrong with the API, so there must be
something wrong with the way you are calling it.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Skip this- I missed the post where OP said it had been running on 32-bit OS :-(.

-----Original Message-----
From: Bob Kjelgaard
Sent: Monday, June 25, 2007 4:41 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] What’s wrong with this function?

Since you don’t dump or print ValueName (and I’m guessing this hasn’t been stepped through ina debugger, either), how do you know it really is what you think it is?

Given everything else you’re saying, I’d guess you didn’t pass it what you think you did.

Hi !

I make many tests and in all tests the error cause in RegDeleteValue()…
But the strange is the message error from FormatMessage()…

“failed with error 2: The system cannot find the file specified”

cannot find FILE?

----- Original Message -----
From: “Bob Kjelgaard”
To: “Windows System Software Devs Interest List”
Sent: Monday, June 25, 2007 8:40 PM
Subject: RE: [ntdev] What’s wrong with this function?

Since you don’t dump or print ValueName (and I’m guessing this hasn’t been
stepped through ina debugger, either), how do you know it really is what you
think it is?

Given everything else you’re saying, I’d guess you didn’t pass it what you
think you did.


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

ERROR_FILE_NOT_FOUND (2) is the generic “can find what you seek”
message. It is saything that the value you wish to delete does not
exist. Accordingly, as has been suggested several times already by Tim
and Bob, if you want help, you need to show us what you are doing:

  1. Code (you’ve already got that)
  2. The name of the keys and values (just pick one specific set if you
    tried several).
  3. Results (KdPrint) for a run with the key and value from (2)

We’re trying here, on a subject that has nothing to do with the purpose
of this list; you’ve got to give us a hand.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of MasvList
Sent: Monday, June 25, 2007 19:50
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] What’s wrong with this function?

Hi !

I make many tests and in all tests the error cause in
RegDeleteValue()…
But the strange is the message error from FormatMessage()…

“failed with error 2: The system cannot find the file specified”

cannot find FILE?

----- Original Message -----
From: “Bob Kjelgaard”
To: “Windows System Software Devs Interest List”
Sent: Monday, June 25, 2007 8:40 PM
Subject: RE: [ntdev] What’s wrong with this function?

Since you don’t dump or print ValueName (and I’m guessing this hasn’t
been
stepped through ina debugger, either), how do you know it really is what
you
think it is?

Given everything else you’re saying, I’d guess you didn’t pass it what
you
think you did.


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

>>

Hi !

I make many tests and in all tests the error cause in RegDeleteValue()…
But the strange is the message error from FormatMessage()…

“failed with error 2: The system cannot find the file specified”

cannot find FILE?
<<

That’s the code the original developers of the registry API chose for this case (value name not found). So by my count, it’s about 15 years or so too late to make an issue of this.

Actually, as I recall it, there was some fuss at one point about people burning up error codes by being too specific, and some guidance to be little less literal in their interpretation (I’m referring to the original release of Win32 / aka NT 3.1). But I don’t trust my recall of last week, much less some niggling project snafu from that long ago…

ANYWAY-

RegDeleteValue works fine on Vista x64- my development machine is an x64, and I have spent most of the last couple of months working (on and off) on a tool that does a LOT of registry manipulation, and one nice thing about UM code is you can do it all on one machine. There is nothing this broken, I’m sure of it.

Are you running afoul of pointer size differences in your code for passing in the values? Assuming pointer size == sizeof DWORD is a mistake sometimes made, and the resulting code works on 32-bit and fails on 64.

Also, have you tried running regmon on your machine and see what’s going on?

Have a nice day
GV

----- Original Message -----
From: “Martin O’Brien”
To: “Windows System Software Devs Interest List”
Sent: Monday, June 25, 2007 5:16 PM
Subject: RE: [ntdev] What’s wrong with this function?

ERROR_FILE_NOT_FOUND (2) is the generic “can find what you seek”
message. It is saything that the value you wish to delete does not
exist. Accordingly, as has been suggested several times already by Tim
and Bob, if you want help, you need to show us what you are doing:

1. Code (you’ve already got that)
2. The name of the keys and values (just pick one specific set if you
tried several).
3. Results (KdPrint) for a run with the key and value from (2)

We’re trying here, on a subject that has nothing to do with the purpose
of this list; you’ve got to give us a hand.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of MasvList
Sent: Monday, June 25, 2007 19:50
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] What’s wrong with this function?

Hi !

I make many tests and in all tests the error cause in
RegDeleteValue()…
But the strange is the message error from FormatMessage()…

“failed with error 2: The system cannot find the file specified”

cannot find FILE?

----- Original Message -----
From: “Bob Kjelgaard”
To: “Windows System Software Devs Interest List”
Sent: Monday, June 25, 2007 8:40 PM
Subject: RE: [ntdev] What’s wrong with this function?

Since you don’t dump or print ValueName (and I’m guessing this hasn’t
been
stepped through ina debugger, either), how do you know it really is what
you
think it is?

Given everything else you’re saying, I’d guess you didn’t pass it what
you
think you did.


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

In this context, it just means that it couldn’t find the value.
Overloaded error messages can be a pain sometimes… oh well.

MasvList wrote:

Hi !

I make many tests and in all tests the error cause in RegDeleteValue()…
But the strange is the message error from FormatMessage()…

“failed with error 2: The system cannot find the file specified”

cannot find FILE?

----- Original Message ----- From: “Bob Kjelgaard”
> To: “Windows System Software Devs Interest List”
> Sent: Monday, June 25, 2007 8:40 PM
> Subject: RE: [ntdev] What’s wrong with this function?
>
>
> Since you don’t dump or print ValueName (and I’m guessing this hasn’t
> been stepped through ina debugger, either), how do you know it really is
> what you think it is?
>
> Given everything else you’re saying, I’d guess you didn’t pass it what
> you think you did.
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>


Ray
(If you want to reply to me off list, please remove “spamblock.” from my
email address)

> In this context, it just means that it couldn’t find the value.

Overloaded error messages can be a pain sometimes… oh well.

It’s amazing to have ~1500 Win32 error codes and still overload them.


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

Maxim S. Shatskih wrote:

> In this context, it just means that it couldn’t find the value.
> Overloaded error messages can be a pain sometimes… oh well.
>

It’s amazing to have ~1500 Win32 error codes and still overload them.

Yes. One of the NT design decisions that has caused me enormous
frustration is the translation of kernel error codes to Win32 error
codes. There are some very useful and very specific kernel error codes
that I would like to communicate out to my applications, but only a tiny
handful get translated, and the rest map to a single Win32 error.

One of my favorite translations is STATUS_DEVICE_DATA_ERROR, which would
seem to indicate a rather general failure in data handling. However,
for reasons that completely escape me, that gets translated to the Win32
code ERROR_CRC, and the FormatError explanation of that is totally useless.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

> One of my favorite translations is STATUS_DEVICE_DATA_ERROR, which

would
seem to indicate a rather general failure in data handling. However,
for reasons that completely escape me, that gets translated to the Win32
code ERROR_CRC, and the FormatError explanation of that is totally useless.

Exactly so. The wording about “CRC” is absolutely useless for most use cases of
STATUS_DEVICE_DATA_ERROR.


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com