Click here to Skip to main content
13,705,841 members
Rate this:
 
Please Sign up or sign in to vote.
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 3-Jan-18 1:30am
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

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

From 'the documentation'[^]:
ERROR_INVALID_NAME
123 (0x7B)
The filename, directory name, or volume label syntax is incorrect.
  Permalink  
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Cookies | Terms of Service
Web01-2016 | 2.8.180920.1 | Last Updated 3 Jan 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100