mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-12-23 23:21:49 +01:00
Get rid of debug error for x86 build
Related to issue #140. Not a great workaround
This commit is contained in:
parent
941479c593
commit
09a7cd8288
@ -87,6 +87,7 @@
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<DefineConstants>PLATFORM_X64</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
|
@ -492,7 +492,12 @@ namespace DS4Windows
|
||||
else
|
||||
{
|
||||
byte[] buffer = new byte[126];
|
||||
NativeMethods.HidD_GetSerialNumberString(safeReadHandle.DangerousGetHandle(), buffer, (ulong)buffer.Length);
|
||||
#if PLATFORM_X64
|
||||
ulong bufferLen = 126;
|
||||
#else
|
||||
uint bufferLen = 126;
|
||||
#endif
|
||||
NativeMethods.HidD_GetSerialNumberString(safeReadHandle.DangerousGetHandle(), buffer, bufferLen);
|
||||
string MACAddr = System.Text.Encoding.Unicode.GetString(buffer).Replace("\0", string.Empty).ToUpper();
|
||||
MACAddr = $"{MACAddr[0]}{MACAddr[1]}:{MACAddr[2]}{MACAddr[3]}:{MACAddr[4]}{MACAddr[5]}:{MACAddr[6]}{MACAddr[7]}:{MACAddr[8]}{MACAddr[9]}:{MACAddr[10]}{MACAddr[11]}";
|
||||
serial = MACAddr;
|
||||
|
@ -391,7 +391,12 @@ namespace DS4Windows
|
||||
[DllImport("hid.dll")]
|
||||
static internal extern int HidP_GetValueCaps(short reportType, ref byte valueCaps, ref short valueCapsLength, IntPtr preparsedData);
|
||||
|
||||
#if PLATFORM_X64
|
||||
[DllImport("hid.dll")]
|
||||
static internal extern bool HidD_GetSerialNumberString(IntPtr HidDeviceObject, byte[] Buffer, ulong BufferLength);
|
||||
#else
|
||||
[DllImport("hid.dll")]
|
||||
static internal extern bool HidD_GetSerialNumberString(IntPtr HidDeviceObject, byte[] Buffer, uint BufferLength);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user