Exemplo n.º 1
0
        internal static bool SetEntryStringArray(string name, string[] value, bool force = false)
        {
            UIntPtr size;

            byte[] namePtr = CreateUTF8String(name, out size);

            NtStringWrite[] ntStrings = new NtStringWrite[value.Length];
            for (int i = 0; i < value.Length; i++)
            {
                ntStrings[i] = new NtStringWrite(value[i]);
            }

            int retVal = Interop.NT_SetEntryStringArray(namePtr, size, ntStrings, (UIntPtr)ntStrings.Length, force ? 1 : 0);

            foreach (var ntString in ntStrings)
            {
                ntString.Dispose();
            }

            return(retVal != 0);
        }