mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-15 17:10:51 -10:00
2009-02-04 Miguel de Icaza <[email protected]>
More patches from Paolo's work, refactored to be integrated into trunk: * icall-def.h: Remove internal calls for sockets when DISABLE_SOCKET is defined, file system writing features when the OS only support reading and not writing data and Policy support if the Policy is disabled. * image.c (do_mono_image_open): Apply Paolo's patches for using mono_file_map_ APIs here. * assembly.c: Add support for platforms to avoid prefix auto-detection. svn path=/trunk/mono/; revision=125757
This commit is contained in:
1 parent
3697185e0d
commit
db3591bb93
4 files changed
+36
-15
No files matched your search
@@ -1,3 +1,16 @@
|
||||
2009-02-04 Miguel de Icaza <[email protected]>
|
||||
|
||||
* icall-def.h: Remove internal calls for sockets when
|
||||
DISABLE_SOCKET is defined, file system writing features when the
|
||||
OS only support reading and not writing data and Policy support if
|
||||
the Policy is disabled.
|
||||
|
||||
* image.c (do_mono_image_open): Apply Paolo's patches for using
|
||||
mono_file_map_ APIs here.
|
||||
|
||||
* assembly.c: Add support for platforms to avoid prefix
|
||||
auto-detection.
|
||||
|
||||
2009-02-04 Zoltan Varga <[email protected]>
|
||||
|
||||
* generic-sharing.c (mono_method_fill_runtime_generic_context): Fix a
|
||||
|
||||
@@ -563,6 +563,8 @@ mono_set_rootdir (void)
|
||||
g_free (installdir);
|
||||
g_free (bindir);
|
||||
g_free (name);
|
||||
#elif defined(DISABLE_MONO_AUTODETECTION)
|
||||
fallback ();
|
||||
#else
|
||||
char buf [4096];
|
||||
int s;
|
||||
|
||||
@@ -46,12 +46,14 @@ ICALL(COMPROX_2, "FindProxy", ves_icall_Mono_Interop_ComInteropProxy_FindProxy)
|
||||
ICALL_TYPE(RUNTIME, "Mono.Runtime", RUNTIME_1)
|
||||
ICALL(RUNTIME_1, "GetDisplayName", ves_icall_Mono_Runtime_GetDisplayName)
|
||||
|
||||
#ifndef PLATFORM_RO_FS
|
||||
ICALL_TYPE(KPAIR, "Mono.Security.Cryptography.KeyPairPersistence", KPAIR_1)
|
||||
ICALL(KPAIR_1, "_CanSecure", ves_icall_Mono_Security_Cryptography_KeyPairPersistence_CanSecure)
|
||||
ICALL(KPAIR_2, "_IsMachineProtected", ves_icall_Mono_Security_Cryptography_KeyPairPersistence_IsMachineProtected)
|
||||
ICALL(KPAIR_3, "_IsUserProtected", ves_icall_Mono_Security_Cryptography_KeyPairPersistence_IsUserProtected)
|
||||
ICALL(KPAIR_4, "_ProtectMachine", ves_icall_Mono_Security_Cryptography_KeyPairPersistence_ProtectMachine)
|
||||
ICALL(KPAIR_5, "_ProtectUser", ves_icall_Mono_Security_Cryptography_KeyPairPersistence_ProtectUser)
|
||||
#endif /* !PLATFORM_RO_FS */
|
||||
|
||||
ICALL_TYPE(ACTIV, "System.Activator", ACTIV_1)
|
||||
ICALL(ACTIV_1, "CreateInstanceInternal", ves_icall_System_Activator_CreateInstanceInternal)
|
||||
@@ -169,6 +171,7 @@ ICALL(DEBUGR_1, "IsAttached_internal", ves_icall_System_Diagnostics_Debugger_IsA
|
||||
ICALL_TYPE(TRACEL, "System.Diagnostics.DefaultTraceListener", TRACEL_1)
|
||||
ICALL(TRACEL_1, "WriteWindowsDebugString", ves_icall_System_Diagnostics_DefaultTraceListener_WriteWindowsDebugString)
|
||||
|
||||
#ifndef DISABLE_PROCESS_HANDLING
|
||||
ICALL_TYPE(FILEV, "System.Diagnostics.FileVersionInfo", FILEV_1)
|
||||
ICALL(FILEV_1, "GetVersionInfo_internal(string)", ves_icall_System_Diagnostics_FileVersionInfo_GetVersionInfo_internal)
|
||||
|
||||
@@ -213,6 +216,7 @@ ICALL(PROCESS_16, "WaitForInputIdle_internal(intptr,int)", ves_icall_System_Diag
|
||||
ICALL_TYPE (PROCESSHANDLE, "System.Diagnostics.Process/ProcessWaitHandle", PROCESSHANDLE_1)
|
||||
ICALL (PROCESSHANDLE_1, "ProcessHandle_close(intptr)", ves_icall_System_Diagnostics_Process_ProcessHandle_close)
|
||||
ICALL (PROCESSHANDLE_2, "ProcessHandle_duplicate(intptr)", ves_icall_System_Diagnostics_Process_ProcessHandle_duplicate)
|
||||
#endif /* !DISABLE_PROCESS_HANDLING */
|
||||
|
||||
ICALL_TYPE(STOPWATCH, "System.Diagnostics.Stopwatch", STOPWATCH_1)
|
||||
ICALL(STOPWATCH_1, "GetTimestamp", mono_100ns_ticks)
|
||||
@@ -300,10 +304,12 @@ ICALL(INOW_3, "RemoveWatch", ves_icall_System_IO_InotifyWatcher_RemoveWatch)
|
||||
|
||||
ICALL_TYPE(MONOIO, "System.IO.MonoIO", MONOIO_1)
|
||||
ICALL(MONOIO_1, "Close(intptr,System.IO.MonoIOError&)", ves_icall_System_IO_MonoIO_Close)
|
||||
#ifndef PLATFORM_RO_FS
|
||||
ICALL(MONOIO_2, "CopyFile(string,string,bool,System.IO.MonoIOError&)", ves_icall_System_IO_MonoIO_CopyFile)
|
||||
ICALL(MONOIO_3, "CreateDirectory(string,System.IO.MonoIOError&)", ves_icall_System_IO_MonoIO_CreateDirectory)
|
||||
ICALL(MONOIO_4, "CreatePipe(intptr&,intptr&)", ves_icall_System_IO_MonoIO_CreatePipe)
|
||||
ICALL(MONOIO_5, "DeleteFile(string,System.IO.MonoIOError&)", ves_icall_System_IO_MonoIO_DeleteFile)
|
||||
#endif /* !PLATFORM_RO_FS */
|
||||
ICALL(MONOIO_34, "DuplicateHandle", ves_icall_System_IO_MonoIO_DuplicateHandle)
|
||||
ICALL(MONOIO_6, "Flush(intptr,System.IO.MonoIOError&)", ves_icall_System_IO_MonoIO_Flush)
|
||||
ICALL(MONOIO_7, "GetCurrentDirectory(System.IO.MonoIOError&)", ves_icall_System_IO_MonoIO_GetCurrentDirectory)
|
||||
@@ -312,13 +318,17 @@ ICALL(MONOIO_9, "GetFileStat(string,System.IO.MonoIOStat&,System.IO.MonoIOError&
|
||||
ICALL(MONOIO_10, "GetFileSystemEntries", ves_icall_System_IO_MonoIO_GetFileSystemEntries)
|
||||
ICALL(MONOIO_11, "GetFileType(intptr,System.IO.MonoIOError&)", ves_icall_System_IO_MonoIO_GetFileType)
|
||||
ICALL(MONOIO_12, "GetLength(intptr,System.IO.MonoIOError&)", ves_icall_System_IO_MonoIO_GetLength)
|
||||
#ifndef PLATFORM_RO_FS
|
||||
ICALL(MONOIO_13, "GetTempPath(string&)", ves_icall_System_IO_MonoIO_GetTempPath)
|
||||
ICALL(MONOIO_14, "Lock(intptr,long,long,System.IO.MonoIOError&)", ves_icall_System_IO_MonoIO_Lock)
|
||||
ICALL(MONOIO_15, "MoveFile(string,string,System.IO.MonoIOError&)", ves_icall_System_IO_MonoIO_MoveFile)
|
||||
#endif /* !PLATFORM_RO_FS */
|
||||
ICALL(MONOIO_16, "Open(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,System.IO.FileOptions,System.IO.MonoIOError&)", ves_icall_System_IO_MonoIO_Open)
|
||||
ICALL(MONOIO_17, "Read(intptr,byte[],int,int,System.IO.MonoIOError&)", ves_icall_System_IO_MonoIO_Read)
|
||||
#ifndef PLATFORM_RO_FS
|
||||
ICALL(MONOIO_18, "RemoveDirectory(string,System.IO.MonoIOError&)", ves_icall_System_IO_MonoIO_RemoveDirectory)
|
||||
ICALL(MONOIO_18M, "ReplaceFile(string,string,string,bool,System.IO.MonoIOError&)", ves_icall_System_IO_MonoIO_ReplaceFile)
|
||||
#endif /* !PLATFORM_RO_FS */
|
||||
ICALL(MONOIO_19, "Seek(intptr,long,System.IO.SeekOrigin,System.IO.MonoIOError&)", ves_icall_System_IO_MonoIO_Seek)
|
||||
ICALL(MONOIO_20, "SetCurrentDirectory(string,System.IO.MonoIOError&)", ves_icall_System_IO_MonoIO_SetCurrentDirectory)
|
||||
ICALL(MONOIO_21, "SetFileAttributes(string,System.IO.FileAttributes,System.IO.MonoIOError&)", ves_icall_System_IO_MonoIO_SetFileAttributes)
|
||||
@@ -400,6 +410,7 @@ ICALL(MTYPE_30, "get_UnderlyingSystemType", ves_icall_MonoType_get_UnderlyingSys
|
||||
ICALL(MTYPE_31, "get_attributes", ves_icall_get_attributes)
|
||||
ICALL(MTYPE_32, "type_from_obj", mono_type_type_from_obj)
|
||||
|
||||
#ifndef DISABLE_SOCKETS
|
||||
ICALL_TYPE(NDNS, "System.Net.Dns", NDNS_1)
|
||||
ICALL(NDNS_1, "GetHostByAddr_internal(string,string&,string[]&,string[]&)", ves_icall_System_Net_Dns_GetHostByAddr_internal)
|
||||
ICALL(NDNS_2, "GetHostByName_internal(string,string&,string[]&,string[]&)", ves_icall_System_Net_Dns_GetHostByName_internal)
|
||||
@@ -433,6 +444,7 @@ ICALL(SOCK_21, "WSAIoctl(intptr,int,byte[],byte[],int&)", ves_icall_System_Net_S
|
||||
|
||||
ICALL_TYPE(SOCKEX, "System.Net.Sockets.SocketException", SOCKEX_1)
|
||||
ICALL(SOCKEX_1, "WSAGetLastError_internal", ves_icall_System_Net_Sockets_SocketException_WSAGetLastError_internal)
|
||||
#endif /* !DISABLE_SOCKETS */
|
||||
|
||||
ICALL_TYPE(NUMBER_FORMATTER, "System.NumberFormatter", NUMBER_FORMATTER_1)
|
||||
ICALL(NUMBER_FORMATTER_1, "GetFormatterTables", ves_icall_System_NumberFormatter_GetFormatterTables)
|
||||
@@ -704,6 +716,7 @@ ICALL(RNG_2, "RngGetBytes", ves_icall_System_Security_Cryptography_RNGCryptoServ
|
||||
ICALL(RNG_3, "RngInitialize", ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_RngInitialize)
|
||||
ICALL(RNG_4, "RngOpen", ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_RngOpen)
|
||||
|
||||
#ifndef DISABLE_POLICY_EVIDENCE
|
||||
ICALL_TYPE(EVID, "System.Security.Policy.Evidence", EVID_1)
|
||||
ICALL(EVID_1, "IsAuthenticodePresent", ves_icall_System_Security_Policy_Evidence_IsAuthenticodePresent)
|
||||
|
||||
@@ -722,6 +735,7 @@ ICALL(WINIMP_4, "SetCurrentToken", ves_icall_System_Security_Principal_WindowsIm
|
||||
ICALL_TYPE(WINPRIN, "System.Security.Principal.WindowsPrincipal", WINPRIN_1)
|
||||
ICALL(WINPRIN_1, "IsMemberOfGroupId", ves_icall_System_Security_Principal_WindowsPrincipal_IsMemberOfGroupId)
|
||||
ICALL(WINPRIN_2, "IsMemberOfGroupName", ves_icall_System_Security_Principal_WindowsPrincipal_IsMemberOfGroupName)
|
||||
#endif /* !DISABLE_POLICY_EVIDENCE */
|
||||
|
||||
ICALL_TYPE(SECSTRING, "System.Security.SecureString", SECSTRING_1)
|
||||
ICALL(SECSTRING_1, "DecryptInternal", ves_icall_System_Security_SecureString_DecryptInternal)
|
||||
|
||||
+7
-15
@@ -877,14 +877,13 @@ do_mono_image_open (const char *fname, MonoImageOpenStatus *status,
|
||||
{
|
||||
MonoCLIImageInfo *iinfo;
|
||||
MonoImage *image;
|
||||
FILE *filed;
|
||||
struct stat stat_buf;
|
||||
MonoFileMap *filed;
|
||||
|
||||
if ((filed = fopen (fname, "rb")) == NULL){
|
||||
if ((filed = mono_file_map_open (fname)) == NULL){
|
||||
if (IS_PORTABILITY_SET) {
|
||||
gchar *ffname = mono_portability_find_file (fname, TRUE);
|
||||
if (ffname) {
|
||||
filed = fopen (ffname, "rb");
|
||||
filed = mono_file_map_open (ffname);
|
||||
g_free (ffname);
|
||||
}
|
||||
}
|
||||
@@ -896,18 +895,12 @@ do_mono_image_open (const char *fname, MonoImageOpenStatus *status,
|
||||
}
|
||||
}
|
||||
|
||||
if (fstat (fileno (filed), &stat_buf)) {
|
||||
fclose (filed);
|
||||
if (status)
|
||||
*status = MONO_IMAGE_ERROR_ERRNO;
|
||||
return NULL;
|
||||
}
|
||||
image = g_new0 (MonoImage, 1);
|
||||
image->raw_buffer_used = TRUE;
|
||||
image->raw_data_len = stat_buf.st_size;
|
||||
image->raw_data = mono_file_map (stat_buf.st_size, MONO_MMAP_READ|MONO_MMAP_PRIVATE, fileno (filed), 0, &image->raw_data_handle);
|
||||
image->raw_data_len = mono_file_map_size (filed);
|
||||
image->raw_data = mono_file_map (image->raw_data_len, MONO_MMAP_READ|MONO_MMAP_PRIVATE, mono_file_map_fd (filed), 0, &image->raw_data_handle);
|
||||
if (!image->raw_data) {
|
||||
fclose (filed);
|
||||
mono_file_map_close (filed);
|
||||
g_free (image);
|
||||
if (status)
|
||||
*status = MONO_IMAGE_IMAGE_INVALID;
|
||||
@@ -919,8 +912,7 @@ do_mono_image_open (const char *fname, MonoImageOpenStatus *status,
|
||||
image->ref_only = refonly;
|
||||
image->ref_count = 1;
|
||||
|
||||
fclose (filed);
|
||||
|
||||
mono_file_map_close (filed);
|
||||
return do_mono_image_load (image, status, care_about_cli);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user