static UBigIntEngine() { var this_assembly = typeof(UBigIntEngine).Assembly; var this_assembly_path = this_assembly.Location; var base_directory_path = Path.GetDirectoryName(this_assembly_path); string sub_dir; if (IntPtr.Size == 8) { sub_dir = "x64"; } else if (IntPtr.Size == 4) { sub_dir = "x86"; } else { throw new PlatformNotSupportedException(); } var dll_dir_path = Path.Combine(base_directory_path, sub_dir); if (!SetDllDirectory(dll_dir_path)) { int error = Marshal.GetLastWin32Error(); throw new InternalErrorException(string.Format("SetDllDirectory がエラーを通知しました。: errno={0}", error)); } PMC_CONFIGURATION_INFO conf = new PMC_CONFIGURATION_INFO(); if (PMCCS_UINT_Initialize(conf) == 0) { throw new InternalErrorException("DLL 'Palmtree.Math.Core.Uint.dll' の初期化に失敗しました。"); } }
private static extern UInt32 PMCCS_UINT_Initialize(PMC_CONFIGURATION_INFO info);