English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

registry programming in C#

2006-07-05 23:30:31 · 2 answers · asked by dutulistrata 1 in Computers & Internet Programming & Design

2 answers

[DllImport("advapi32.dll", EntryPoint="RegCreateKeyExW")]
public static extern uint RegCreateKeyEx
(uint hKey, string lpSubKey, int Reserved,
string lpClass, uint dwOptions, uint samDesired,
ref int lpSecurityAttributes,
ref uint phkResult, ref int lpdwDisposition);

the call
uint result = Auth.RegCreateKeyEx(Auth.HKEY_CURRENT_USER, opkey, 0, null, Auth.REG_OPTION_VOLATILE, Auth.KEY_ALL_ACCESS, ref securityattr, ref _hkey, ref disposition);
//
// MessageId: ERROR_INVALID_PARAMETER
//
// MessageText:
//
// The parameter is incorrect.
//
#define ERROR_INVALID_PARAMETER 87L // dderror

Note:

the program runs from the Admoinistrator's account.

2006-07-05 23:38:29 · answer #1 · answered by Joe_Young 6 · 1 0

Yeah

I can't help you... it's too far above me. the last two prams should be pointers.

2006-07-05 23:35:35 · answer #2 · answered by Raylene G. 4 · 0 0

fedest.com, questions and answers