Skip to content

Commit

Permalink
Convert Firmware class to static and use Span types
Browse files Browse the repository at this point in the history
  • Loading branch information
Kytech committed Jan 15, 2023
1 parent e28f732 commit cdf46a8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Firmware.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
using System.Runtime.InteropServices;
using System;
using System.Runtime.InteropServices;

namespace BootMan
{
internal sealed class Firmware
internal static class Firmware
{
public enum FirmwareType
{
Expand All @@ -17,20 +18,19 @@ public enum FirmwareType
[DllImport("Kernel32.dll")]
private static extern bool GetFirmwareType(out FirmwareType firmwareType);

// TODO: Refactor these to use Span<uint16> instead
[DllImport("Kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
private static extern uint GetFirmwareEnvironmentVariable(
string lpName,
string lpGuid,
byte[] lpBuffer,
Span<ushort> lpBuffer,
uint nSize
);

[DllImport("Kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
private static extern bool SetFirmwareEnvironmentVariable(
string lpName,
string lpGuid,
byte[] lpBuffer,
Span<ushort> lpBuffer,
uint nSize
);

Expand Down

0 comments on commit cdf46a8

Please sign in to comment.