Exemplo n.º 1
0
        public static UInt32 LWMGMTFreeKeyTabEntries(IntPtr pKeyTabEntries)
        {
            UInt32 result       = 0;
            string functionName = "LSAMgmtAPI.LWMGMTFreeKeyTabEntries";

            try
            {
                Logger.Log(String.Format(
                               "{0} called",
                               functionName), Logger.LSAMgmtLogLevel);

                if (!IntPtr.Zero.Equals(pKeyTabEntries))
                {
                    result = PrivateLSAMgmtAPI.LWMGMTFreeKeyTabEntries(pKeyTabEntries);
                    if (result != 0)
                    {
                        Logger.Log(String.Format(
                                       "WARNING: PrivateLSAMgmtAPI.LWMGMTFreeKeyTabEntries reports failure! [code={0}]",
                                       result),
                                   Logger.LogLevel.Panic);
                    }
                }

                Logger.Log(String.Format(
                               "{0}: result={1}",
                               functionName,
                               result),
                           Logger.LSAMgmtLogLevel);
            }
            catch (Exception ex)
            {
                Logger.LogException(functionName, ex);
                if (result == 0)
                {
                    result = 0xFFFFFFFF;
                }
            }

            return(result);
        }