473,396 Members | 1,797 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Insufficient privilage when call RegLoadKey

Hi,

I log in as a administrator, then compile and run the following code on a
computer:

#include "stdafx.h"
#include <windows.h>

int _tmain(int argc, _TCHAR* argv[])
{
long l = ::RegLoadKey(HKEY_USERS,L"XXXX",L"D:\\NTUSER.DAT") ;
return 0;
}

I get a 1314(A required privilege is not held by the client ) error when
call RegLoadKey, but i am an administrator!!! What the hell?

Thanks in advance
-Joe
Jan 10 '07 #1
1 5864
>I log in as a administrator, then compile and run the following code on a
>computer:

#include "stdafx.h"
#include <windows.h>

int _tmain(int argc, _TCHAR* argv[])
{
long l = ::RegLoadKey(HKEY_USERS,L"XXXX",L"D:\\NTUSER.DAT") ;
return 0;
}

I get a 1314(A required privilege is not held by the client ) error when
call RegLoadKey, but i am an administrator!!! What the hell?
Joe,

The documentation notes:

"The calling process must have the SE_RESTORE_NAME and SE_BACKUP_NAME
privileges on the computer in which the registry resides. For more
information, see Running with Special Privileges. To load a hive
without requiring these special privileges, use the RegLoadAppKey
function.
"

Just because you're an admin account doesn't necessarily mean that you
have those privileges.

Dave
Jan 10 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Bernard André | last post by:
Hi All, context: I am using Access 97 tablkes with VB. I can see records in the MDB, using Adodc and datagrid. No problem. But when doing: rsprivate.AddNew rsprivate!For =...
5
by: Leonardo Almeida | last post by:
This is the case.... I would like to learn the statement that make the relation between these tables. Why? Cos these are separated in two different databases and if a user make an update in a...
3
by: Bert | last post by:
I am sertainly no SQL expert so I am looking for a bit of help (actually quite desperate). The extra CPU and 1GB of RAM to be added to a server (Compaq DL380 G2: 1.4 GHz PIII with a Gig of RAM)...
2
by: Squid Seven | last post by:
I have created a class that contains an instance of a second class. When i try to call a member function of the instance of the second class from a member function of the containing class, I get...
3
by: Sean McKaharay | last post by:
I am using the code below and I am getting this error: "Insufficient state to deserialize the object. More information is needed." Has anyone seen this? It is working with other dll's but not on a...
5
by: Ed McAndrew | last post by:
Hi, I'm having to hack (because I don’t know c# very well) together a migration application for my company for use with migrating to active directory. (using VS2005/.NET 2.0) The goal is to...
0
by: blazerguns | last post by:
Hi all, I have recently written a code for Automatic update management using the Apis in MSDN. I tested it using "ASP .NET Development Server". It seems to work fine. As soon i launched it as a...
3
by: Gladiator | last post by:
Hi , Can someone tell me how do i grant a Read privilage on all the tables in a schema X to a different user who is not the owner of the Schema . I dont want to grant him the Alterin privilage...
2
JustRun
by: JustRun | last post by:
Hi, I can create a new Role, its simple, But it will be no use if the user cant define privilage to this role, like allow access to some pages, and deny it to athe pages? I use the Web.Config...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.