Esempio n. 1
0
            /// <summary>
            /// Store the passed in "boot vars" as the system's current "boot vars".
            /// </summary>
            /// <param name="bootVars"></param>
            internal static void Save(BootVars bootVars)
            {
                bool success = false;

                try
                {
                    unsafe
                    {
                        success = bootvars_write(ref bootVars);   // Will set LastError on failure.
                    }

                    if (!success)
                    {
                        int lastError = WinCeApi.GetLastError();
                        throw new ConfigurationException(string.Format("Error {0} writing BootVars", lastError));
                    }
                }
                catch (ConfigurationException)
                {
                    throw;
                }
                catch (Exception ex)
                {
                    throw new ConfigurationException("Error writing BootVars", ex);
                }
                finally
                {
                    bootvars_deinit();
                }
            }
Esempio n. 2
0
            /// <summary>
            /// Return the system's current "boot vars"
            /// </summary>
            /// <returns></returns>
            static internal BootVars Load()
            {
                BootVars bootVars = new BootVars();

                bool success = false;

                try
                {
                    unsafe
                    {
                        success = bootvars_read(ref bootVars);    // Will set LastError on failure.
                    }

                    if (!success)
                    {
                        int lastError = WinCeApi.GetLastError();
                        throw new ConfigurationException(string.Format("Error {0} reading BootVars", lastError));
                    }
                }
                catch (ConfigurationException)
                {
                    throw;
                }
                catch (Exception ex)
                {
                    throw new ConfigurationException("Error reading BootVars", ex);
                }
                finally
                {
                    bootvars_deinit();
                }
                return(bootVars);
            }
Esempio n. 3
0
 private static unsafe extern bool bootvars_write(ref BootVars bootVars);
Esempio n. 4
0
 private static unsafe extern bool bootvars_read(ref BootVars bootVars);