From 47c70399087538455713ad14bac79a6be963ae61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz=20=28arab=2C=20vx?= =?UTF-8?q?p=29?= Date: Sun, 19 Jun 2016 18:21:22 +0000 Subject: Moved local ntapi and psxscl patches to separate branch. --- ntapi.local.patch | 67 ------------------- psxscl.local@lucio-vm.local.patch | 137 -------------------------------------- 2 files changed, 204 deletions(-) delete mode 100644 ntapi.local.patch delete mode 100644 psxscl.local@lucio-vm.local.patch diff --git a/ntapi.local.patch b/ntapi.local.patch deleted file mode 100644 index d69de097..00000000 --- a/ntapi.local.patch +++ /dev/null @@ -1,67 +0,0 @@ -diff --git a/include/ntapi/nt_mount.h b/include/ntapi/nt_mount.h -index 8a7258a..cf2deac 100644 ---- a/include/ntapi/nt_mount.h -+++ b/include/ntapi/nt_mount.h -@@ -10,6 +10,10 @@ - #define __DEVICE_PATH_PREFIX_LEN (8 * sizeof(wchar16_t)) - #define __DEVICE_PATH_PREFIX_HASH (0xDA6FA40B) - -+/* {'\\','D','e','v','i','c','e','\\',M','u','p','\\'} */ -+#define __DEVICE_MUP_PATH_PREFIX_LEN (12 * sizeof(wchar16_t)) -+#define __DEVICE_MUP_PATH_PREFIX_HASH (0x0CEBB5F6) -+ - /* {'\\','?','?','\\','V','o','l','u','m','e','{'} */ - #define __VOLUME_PATH_PREFIX_LEN (11 * sizeof(wchar16_t)) - #define __VOLUME_PATH_PREFIX_HASH (0xFEBA8529) -diff --git a/src/fs/ntapi_tt_statfs.c b/src/fs/ntapi_tt_statfs.c -index 114cc8e..8bc43e2 100644 ---- a/src/fs/ntapi_tt_statfs.c -+++ b/src/fs/ntapi_tt_statfs.c -@@ -23,7 +23,7 @@ int32_t __stdcall __ntapi_tt_statfs( - nt_oa oa; - nt_iosb iosb; - nt_unicode_string * sdev; -- uint32_t hash; -+ uint32_t hash,hash_mup; - wchar16_t * wch; - wchar16_t * wch_mark; - uint32_t offset; -@@ -156,6 +156,14 @@ int32_t __stdcall __ntapi_tt_statfs( - if (hash != __DEVICE_PATH_PREFIX_HASH) - return NT_STATUS_INVALID_HANDLE; - -+ hash_mup = __ntapi->tt_buffer_crc32( -+ 0, -+ sdev->buffer, -+ __DEVICE_MUP_PATH_PREFIX_LEN); -+ -+ if (hash_mup == __DEVICE_MUP_PATH_PREFIX_HASH) -+ sdev->buffer[__DEVICE_MUP_PATH_PREFIX_LEN - 1] = 0; -+ - wch_mark = sdev->buffer + __DEVICE_PATH_PREFIX_LEN/sizeof(wchar16_t); - wch = wch_mark; - while (*wch != '\\') wch++; -@@ -190,6 +198,9 @@ int32_t __stdcall __ntapi_tt_statfs( - statfs->nt_control_flags = 0; - statfs->nt_padding = 0; - -+ if (hash_mup == __DEVICE_MUP_PATH_PREFIX_HASH) -+ return NT_STATUS_SUCCESS; -+ - if (!(flags & NT_STATFS_VOLUME_GUID)) { - statfs->nt_drive_letter = 0; - pguid = (uint64_t *)&(statfs->nt_volume_guid); -diff --git a/src/fs/ntapi_tt_open_physical_parent_directory.c b/src/fs/ntapi_tt_open_physical_parent_directory.c -index 68d282b..742607d 100644 ---- a/src/fs/ntapi_tt_open_physical_parent_directory.c -+++ b/src/fs/ntapi_tt_open_physical_parent_directory.c -@@ -37,6 +37,9 @@ int32_t __stdcall __ntapi_tt_open_physical_parent_directory( - return NT_STATUS_BAD_FILE_TYPE; - - wch = path->buffer + (path->strlen / sizeof(uint16_t)); -+ if ((&wch[-1] >= path->buffer) && (wch[-1] == '\\') && -+ (&wch[-2] >= path->buffer)) -+ wch = &wch[-1]; - while ((--wch >= path->buffer) && (*wch != '\\')); - - if (wch == path->buffer ) diff --git a/psxscl.local@lucio-vm.local.patch b/psxscl.local@lucio-vm.local.patch deleted file mode 100644 index 1b3b9c02..00000000 --- a/psxscl.local@lucio-vm.local.patch +++ /dev/null @@ -1,137 +0,0 @@ -diff --git a/src/iofn/psx_iofn_fsdir.c b/src/iofn/psx_iofn_fsdir.c -index 53b3380..8bdd7d8 100644 ---- a/src/iofn/psx_iofn_fsdir.c -+++ b/src/iofn/psx_iofn_fsdir.c -@@ -52,10 +52,34 @@ static int32_t __fastcall __psx_iofn_fsdir_open_next( - path.buffer++; - } - -+ /* XXX */ -+ uint32_t status; -+ static char name_buffer[1024]; -+ nt_unicode_string * dev_name,full_path; -+ -+ iosb.info = 0; -+ if ((status = __ntapi->zw_query_object( -+ path_info->hat,NT_OBJECT_NAME_INFORMATION, -+ name_buffer,sizeof(name_buffer),(uint32_t *)&iosb.info))) -+ return status; -+ else { -+ dev_name = (nt_unicode_string *)name_buffer; -+ if ((dev_name->strlen > 2) && -+ (dev_name->buffer[(dev_name->strlen - 1) / 2] != '\\')) { -+ dev_name->buffer[dev_name->strlen / 2] = '\\'; -+ dev_name->strlen += 2; -+ } -+ __ntapi->tt_generic_memcpy(&dev_name->buffer[dev_name->strlen / 2], -+ path.buffer,path.strlen); -+ dev_name->strlen += path.strlen; -+ full_path.maxlen = (full_path.strlen = dev_name->strlen) + 2; -+ full_path.buffer = dev_name->buffer; -+ } -+ - /* oa */ - oa.len = sizeof(nt_oa); -- oa.root_dir = path_info->hat; -- oa.obj_name = &path; -+ oa.root_dir = 0; -+ oa.obj_name = &full_path; - oa.obj_attr = path_info->ntobjattr; - oa.sec_desc = 0; - oa.sec_qos = 0; -@@ -73,6 +97,45 @@ static int32_t __fastcall __psx_iofn_fsdir_open_next( - 0,0); - } - -+static int32_t __stdcall __psx_iofn_fsdir_open_parent_directory( -+ void ** hparent, -+ void * hdir, -+ uintptr_t * buffer, -+ uint32_t buffer_size, -+ uint32_t desired_access, -+ uint32_t open_options, -+ int32_t * type) -+{ -+ uint32_t status; -+ nt_io_status_block iosb; -+ nt_file_internal_information fii_hdir,fii_hroot; -+ struct __psx_tlca * tlca; -+ -+ tlca = __tlca_self(); -+ status = __ntapi->zw_query_information_file( -+ hdir,&iosb,&fii_hdir,sizeof(fii_hdir), -+ NT_FILE_INTERNAL_INFORMATION); -+ if (status) -+ return status; -+ status = __ntapi->zw_query_information_file( -+ tlca->ctx->root.hfile,&iosb,&fii_hroot,sizeof(fii_hroot), -+ NT_FILE_INTERNAL_INFORMATION); -+ if (status) -+ return status; -+ if (fii_hdir.index_number.quad == fii_hroot.index_number.quad) { -+ *hparent = hdir; -+ *type = PSX_FD_OS_FS_ROOT; -+ status = NT_STATUS_SUCCESS; -+ } else -+ status = __ntapi->tt_open_physical_parent_directory( -+ hparent,hdir, -+ buffer, -+ buffer_size, -+ desired_access, -+ open_options,type); -+ return status; -+} -+ - int32_t __stdcall __psx_iofn_fsdir_getvents( - void * hfile, - void * hevent, -@@ -133,6 +196,6 @@ void __fastcall __psx_iofn_fsdir_init(struct __iovtbl * iovtbl) - iovtbl->getdents = __ntapi->zw_query_directory_file; - iovtbl->getvents = __psx_iofn_fsdir_getvents; - -- iovtbl->open_logical_parent = __ntapi->tt_open_logical_parent_directory; -- iovtbl->open_physical_parent = __ntapi->tt_open_physical_parent_directory; -+ iovtbl->open_logical_parent = __psx_iofn_fsdir_open_parent_directory; -+ iovtbl->open_physical_parent = __psx_iofn_fsdir_open_parent_directory; - } -diff --git a/src/path/psx_path_parse.c b/src/path/psx_path_parse.c -index ff4d933..08431b6 100644 ---- a/src/path/psx_path_parse.c -+++ b/src/path/psx_path_parse.c -@@ -48,8 +48,8 @@ int32_t __fastcall __psx_parse_normalized_path_utf8( - ch, - ++(path_info->depth)); - -- if (*(++ch)=='/') { -- ch++; -+ if (ch[1]=='/') { -+ ch+=2; - } - } - -diff --git a/src/path/psx_path_resolve.c b/src/path/psx_path_resolve.c -index 2bd615c..705e646 100644 ---- a/src/path/psx_path_resolve.c -+++ b/src/path/psx_path_resolve.c -@@ -260,7 +260,7 @@ static int __fastcall __path_swap_at( - int32_t status; - - /* swap */ -- if (path_info->pathflags & PSX_PATH_CLOSE_AT) -+ if ((path_info->pathflags & PSX_PATH_CLOSE_AT) && (path_info->hat != path_info->hfile)) - if ((status = __iovtbl[path_info->fdtypeat].close(path_info->hat))) - return status; - -diff --git a/src/process/_execve.c b/src/process/_execve.c -index a623d2a..80dd4a9 100644 ---- a/src/process/_execve.c -+++ b/src/process/_execve.c -@@ -232,7 +232,7 @@ intptr_t __sys_execve(const unsigned char * path, const char ** argv, const char - NT_SECTION_QUERY|NT_SECTION_MAP_EXECUTE, - &oa,&ssize, - NT_PAGE_EXECUTE, -- NT_SEC_IMAGE, -+ NT_SEC_RESERVE, - image->info.hfile))) - return __execve_return(tlca,0,target,-ENOEXEC); - -- cgit v1.2.3