Click here to Skip to main content
15,884,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
iam using RegSaveKey API to save key but it is returning error code 123 what iam doing
wrong

What I have tried:

 [DllImport("advapi32.dll", CharSet = CharSet.Auto, SetLastError = true)]
        public static extern int RegSaveKey(UIntPtr hKey, [MarshalAs(UnmanagedType.LPStr)]string filename, IntPtr samDesired);

UIntPtr reg = UIntPtr.Zero;
string SaveFileName="myfilePath"

RegSaveKey(reg, SaveFileName, IntPtr.Zero);
Posted
Updated 3-Jan-18 1:46am
Comments
F-ES Sitecore 3-Jan-18 7:38am    
.net has its own classes for manipulating the registry, there is no point in using dll calls.
srilekhamenon 4-Jan-18 4:04am    
what is there .net equivalent sir

1 solution

From 'the documentation'[^]:
ERROR_INVALID_NAME
123 (0x7B)
The filename, directory name, or volume label syntax is incorrect.
 
Share this answer
 
Comments
srilekhamenon 3-Jan-18 8:05am    
i have already checked the path and path is fine my path is
C:\Windows\System32\Config\RCCBakup\s-1-5-20.bak

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900