Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ PtrToStructure() [1/2]

static ? object System.Runtime.InteropServices.Marshal.PtrToStructure ( IntPtr ptr,
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] Type structureType )
inlinestatic

Definition at line 1164 of file Marshal.cs.

1165 {
1166 if (ptr == IntPtr.Zero)
1167 {
1168 return null;
1169 }
1170 if ((object)structureType == null)
1171 {
1172 throw new ArgumentNullException("structureType");
1173 }
1174 if (structureType.IsGenericType)
1175 {
1176 throw new ArgumentException(SR.Argument_NeedNonGenericType, "structureType");
1177 }
1178 if (!structureType.IsRuntimeImplemented())
1179 {
1180 throw new ArgumentException(SR.Argument_MustBeRuntimeType, "structureType");
1181 }
1182 object obj = Activator.CreateInstance(structureType, nonPublic: true);
1183 PtrToStructureHelper(ptr, obj, allowValueClasses: true);
1184 return obj;
1185 }
static void PtrToStructureHelper(IntPtr ptr, object structure, bool allowValueClasses)

References System.SR.Argument_MustBeRuntimeType, System.SR.Argument_NeedNonGenericType, System.Activator.CreateInstance(), System.Type.IsGenericType, System.Type.IsRuntimeImplemented(), System.obj, System.Runtime.InteropServices.Marshal.PtrToStructureHelper(), and System.IntPtr.Zero.

Referenced by System.Security.Principal.WindowsIdentity.AddDeviceGroupSidClaims(), System.Security.Principal.WindowsIdentity.AddGroupSidClaims(), System.Security.Principal.WindowsIdentity.AddPrimarySidClaim(), System.Security.Principal.WindowsIdentity.AddTokenClaims(), System.Net.NetworkInformation.Ping.CreatePingReply(), Interop.Crypt32.FindAlgIdOidInfo(), Interop.Crypt32.FindOidInfo(), System.Diagnostics.FileVersionInfo.GetFixedFileInfo(), System.Net.NetworkInformation.HostInformationPal.GetFixedInfo(), ReLogic.Peripherals.RGB.Corsair.CorsairHelper.GetLedPositionsForMouseMatOrKeyboard(), System.Net.NetworkInformation.SystemNetworkInterface.GetNetworkInterfaces(), System.Net.NetworkInformation.SystemIPv4InterfaceProperties.GetPerAdapterInfo(), ReLogic.Peripherals.RGB.Corsair.CorsairDeviceGroup.Initialize(), Interop.IpHlpApi.IpAdapterAddress.MarshalIpAddressCollection(), Interop.IpHlpApi.IpAdapterAddress.MarshalIpAddressInformationCollection(), System.Net.NetworkInformation.SystemUnicastIPAddressInformation.MarshalUnicastIpAddressInformationCollection(), and System.Security.Principal.SecurityIdentifier.TranslateToNTAccounts().