diff --git a/README.md b/README.md index cdd4025..0d035b5 100644 --- a/README.md +++ b/README.md @@ -125,13 +125,13 @@ The modern Client32 path is implemented through a small reusable helper layer: The working sequence is: ```text -C32_MapVar_Probe(4,0) +NCP_MapVar_Probe(4,0) -> obtains the active connection reference -C32_OpenRef_Probe() +NCP_OpenRef_Probe() -> opens that reference and returns a Client32 handle -C32_NCP87_Raw5_Probe() +NCP_Raw5_Probe() -> sends NCP 87 requests through COMPATNcpRequestReply ``` diff --git a/c32ncp.c b/c32ncp.c index 79e830a..220ee7a 100644 --- a/c32ncp.c +++ b/c32ncp.c @@ -612,7 +612,7 @@ int ncp17_3d_read_property_value(uint16 objtyp, uint8 *objname, int segment, /* - * c32_copy_open_reply_to_handle6 + * ncp_copy_open_reply_to_handle6 * * Purpose: * Extracts the six-byte server file handle from an NCP87/01 Open/Create @@ -623,7 +623,7 @@ int ncp17_3d_read_property_value(uint16 objtyp, uint8 *objname, int segment, * helper keeps the extraction in one place so the code can be corrected * without touching the callers. */ -static void c32_copy_open_reply_to_handle6(C32_NWFILE_HANDLE6 *dst, +static void ncp_copy_open_reply_to_handle6(NCP_FILE_HANDLE6 *dst, const uint8 *src) { /* @@ -666,7 +666,7 @@ int ncp87_01_open_create_entry(const char *path_name, uint32 create_attrs, uint16 desired_access, uint16 search_attrs, - C32_NWFILE_HANDLE6 *handle_out, + NCP_FILE_HANDLE6 *handle_out, uint32 *file_size_out, uint8 *open_create_action_out, uint16 *actual_out, @@ -695,7 +695,7 @@ int ncp87_01_open_create_entry(const char *path_name, if (!path_name || !handle_out) return(1); - rc = c32_get_ncp_handle(&handle_lo, &handle_hi); + rc = ncp_get_requester_handle(&handle_lo, &handle_hi); if (rc) return(10 + rc); @@ -723,14 +723,14 @@ int ncp87_01_open_create_entry(const char *path_name, tool_put_dword_lh(hdr + 9, create_attrs); tool_put_word_lh(hdr + 13, desired_access); - path_len = c32_build_handle_path_from_dos_path(path, (uint8)dir_handle, + path_len = ncp_build_handle_path_from_dos_path(path, (uint8)dir_handle, 0, 0, path_name); memset(rep0, 0, sizeof(rep0)); memset(rep1, 0, sizeof(rep1)); memset(rawout, 0, sizeof(rawout)); - C32_NCP87_Raw5_Probe(handle_lo, handle_hi, + NCP_Raw5_Probe(handle_lo, handle_hi, hdr, 15, path, path_len, rep0, sizeof(rep0), @@ -748,7 +748,7 @@ int ncp87_01_open_create_entry(const char *path_name, if (raw_ret_ax != 0 || raw_ret_dx != 0) return(20); - c32_copy_open_reply_to_handle6(handle_out, rep0 + 0); + ncp_copy_open_reply_to_handle6(handle_out, rep0 + 0); if (open_create_action_out) *open_create_action_out = rep0[6]; @@ -777,8 +777,8 @@ int ncp87_01_open_create_entry(const char *path_name, * Offsets and byte count are encoded high-low. The source and destination * handles must be the six-byte server handles accepted by the file server. */ -int ncp74_file_server_copy(const C32_NWFILE_HANDLE6 *src, - const C32_NWFILE_HANDLE6 *dst, +int ncp74_file_server_copy(const NCP_FILE_HANDLE6 *src, + const NCP_FILE_HANDLE6 *dst, uint32 src_offset, uint32 dst_offset, uint32 count, @@ -836,7 +836,7 @@ int ncp74_file_server_copy(const C32_NWFILE_HANDLE6 *src, * Requester path: * Direct F242 Net_Call wrapper. */ -int ncp66_close_file(const C32_NWFILE_HANDLE6 *handle) +int ncp66_close_file(const NCP_FILE_HANDLE6 *handle) { struct { uint8 len; @@ -903,7 +903,7 @@ int ncp87_06_obtain_rim_attributes(const char *name, if (handle_lo_out) *handle_lo_out = 0; if (handle_hi_out) *handle_hi_out = 0; - rc = c32_get_ncp_handle(&handle_lo, &handle_hi); + rc = ncp_get_requester_handle(&handle_lo, &handle_hi); if (rc) return(10 + rc); @@ -914,14 +914,14 @@ int ncp87_06_obtain_rim_attributes(const char *name, tool_put_word_lh(hdr + 3, 0x0006); /* SA_ALL */ tool_put_dword_lh(hdr + 5, 0x00000004UL); /* RIM_ATTRIBUTES */ - path_len = c32_build_handle_path(path, (uint8)dir_handle, 0, 0, 1, + path_len = ncp_build_handle_path(path, (uint8)dir_handle, 0, 0, 1, name, NULL, NULL); memset(rep0, 0, sizeof(rep0)); memset(rep1, 0, sizeof(rep1)); memset(rawout, 0, sizeof(rawout)); - C32_NCP87_Raw5_Probe(handle_lo, handle_hi, + NCP_Raw5_Probe(handle_lo, handle_hi, hdr, 9, path, (UI)path_len, rep0, 0x4d, @@ -966,7 +966,7 @@ int ncp87_06_obtain_rim_attributes(const char *name, */ int ncp87_06_obtain_ndir_info(const char *path_name, uint16 dir_handle, - C32_NDIR_INFO *info_out, + NCP_NDIR_INFO *info_out, uint16 *actual_out, uint16 *handle_lo_out, uint16 *handle_hi_out) @@ -991,7 +991,7 @@ int ncp87_06_obtain_ndir_info(const char *path_name, if (handle_lo_out) *handle_lo_out = 0; if (handle_hi_out) *handle_hi_out = 0; - rc = c32_get_ncp_handle(&handle_lo, &handle_hi); + rc = ncp_get_requester_handle(&handle_lo, &handle_hi); if (rc) return(10 + rc); @@ -1017,14 +1017,14 @@ int ncp87_06_obtain_ndir_info(const char *path_name, tool_put_word_lh(hdr + 3, 0x0006); /* SA_ALL */ tool_put_dword_lh(hdr + 5, 0x00000FFFUL); /* RIM_ALL */ - path_len = c32_build_handle_path_from_dos_path(path, (uint8)dir_handle, + path_len = ncp_build_handle_path_from_dos_path(path, (uint8)dir_handle, 0, 0, path_name); memset(rep0, 0, sizeof(rep0)); memset(rep1, 0, sizeof(rep1)); memset(rawout, 0, sizeof(rawout)); - C32_NCP87_Raw5_Probe(handle_lo, handle_hi, + NCP_Raw5_Probe(handle_lo, handle_hi, hdr, 9, path, path_len, rep0, sizeof(rep0), @@ -1095,7 +1095,7 @@ int ncp87_06_obtain_ndir_info(const char *path_name, int ncp87_07_modify_dos_info(const char *name, uint16 dir_handle, uint32 change_mask, - C32_DOS_MODIFY_INFO *info, + NCP_DOS_MODIFY_INFO *info, uint16 *actual_out, uint16 *handle_lo_out, uint16 *handle_hi_out) @@ -1123,7 +1123,7 @@ int ncp87_07_modify_dos_info(const char *name, if (handle_hi_out) *handle_hi_out = 0; - rc = c32_get_ncp_handle(&handle_lo, &handle_hi); + rc = ncp_get_requester_handle(&handle_lo, &handle_hi); if (rc) return(10 + rc); @@ -1169,14 +1169,14 @@ int ncp87_07_modify_dos_info(const char *name, tool_put_dword_lh(p, info->maximum_space); p += 4; mod_len = (UI)(p - modbuf); - path_len = c32_build_handle_path(path, (uint8)dir_handle, 0, 0, 1, + path_len = ncp_build_handle_path(path, (uint8)dir_handle, 0, 0, 1, name, NULL, NULL); memset(rep0, 0, sizeof(rep0)); memset(rep1, 0, sizeof(rep1)); memset(rawout, 0, sizeof(rawout)); - C32_NCP87_Raw5_Probe(handle_lo, handle_hi, + NCP_Raw5_Probe(handle_lo, handle_hi, modbuf, mod_len, path, path_len, rep0, sizeof(rep0), @@ -1217,7 +1217,7 @@ int ncp87_07_modify_dos_attributes(char *name, uint16 *handle_lo_out, uint16 *handle_hi_out) { - C32_DOS_MODIFY_INFO info; + NCP_DOS_MODIFY_INFO info; memset(&info, 0, sizeof(info)); info.attributes = attrs; @@ -1274,7 +1274,7 @@ int ncp87_1d_get_effective_rights(const char *path_name, if (handle_lo_out) *handle_lo_out = 0; if (handle_hi_out) *handle_hi_out = 0; - rc = c32_get_ncp_handle(&handle_lo, &handle_hi); + rc = ncp_get_requester_handle(&handle_lo, &handle_hi); if (rc) return(10 + rc); @@ -1298,14 +1298,14 @@ int ncp87_1d_get_effective_rights(const char *path_name, tool_put_word_lh(hdr + 3, 0x0006); /* SA_ALL */ tool_put_dword_lh(hdr + 5, 0L); /* reserved */ - path_len = c32_build_handle_path_from_dos_path(path, (uint8)dir_handle, + path_len = ncp_build_handle_path_from_dos_path(path, (uint8)dir_handle, 0, 0, path_name); memset(rep0, 0, sizeof(rep0)); memset(rep1, 0, sizeof(rep1)); memset(rawout, 0, sizeof(rawout)); - C32_NCP87_Raw5_Probe(handle_lo, handle_hi, + NCP_Raw5_Probe(handle_lo, handle_hi, hdr, 9, path, path_len, rep0, sizeof(rep0), @@ -1380,7 +1380,7 @@ int ncp87_1d_get_effective_rights_by_dirent(uint8 vol_number, if (handle_lo_out) *handle_lo_out = 0; if (handle_hi_out) *handle_hi_out = 0; - rc = c32_get_ncp_handle(&handle_lo, &handle_hi); + rc = ncp_get_requester_handle(&handle_lo, &handle_hi); if (rc) return(10 + rc); @@ -1413,7 +1413,7 @@ int ncp87_1d_get_effective_rights_by_dirent(uint8 vol_number, memset(rep1, 0, sizeof(rep1)); memset(rawout, 0, sizeof(rawout)); - C32_NCP87_Raw5_Probe(handle_lo, handle_hi, + NCP_Raw5_Probe(handle_lo, handle_hi, hdr, 9, path, 7, rep0, sizeof(rep0), @@ -1444,7 +1444,7 @@ int ncp87_1d_get_effective_rights_by_dirent(uint8 vol_number, /* - * c32_build_ncp22_trustee_path + * ncp22_build_trustee_path * * Purpose: * Builds the volume-qualified path format required by old NCP22 trustee @@ -1454,7 +1454,7 @@ int ncp87_1d_get_effective_rights_by_dirent(uint8 vol_number, * This helper intentionally strips the server component and leaves a * SYS:DIR\FILE style path for directory handle 0 requests. */ -static int c32_build_ncp22_trustee_path(char *out, const char *path_name, int max) +static int ncp22_build_trustee_path(char *out, const char *path_name, int max) { char header[300]; char *p; @@ -1524,7 +1524,7 @@ int ncp22_27_set_trustee_rights(const char *path_name, (void)dir_handle; - if (c32_build_ncp22_trustee_path(ncppath, path_name, sizeof(ncppath))) + if (ncp22_build_trustee_path(ncppath, path_name, sizeof(ncppath))) return(30); pathlen = strlen(ncppath); @@ -1583,7 +1583,7 @@ int ncp22_2b_delete_trustee_rights(const char *path_name, (void)dir_handle; - if (c32_build_ncp22_trustee_path(ncppath, path_name, sizeof(ncppath))) + if (ncp22_build_trustee_path(ncppath, path_name, sizeof(ncppath))) return(30); pathlen = strlen(ncppath); @@ -1647,7 +1647,7 @@ int ncp87_0a_add_trustee_rights(const char *path_name, if (handle_lo_out) *handle_lo_out = 0; if (handle_hi_out) *handle_hi_out = 0; - rc = c32_get_ncp_handle(&handle_lo, &handle_hi); + rc = ncp_get_requester_handle(&handle_lo, &handle_hi); if (rc) return(10 + rc); @@ -1676,7 +1676,7 @@ int ncp87_0a_add_trustee_rights(const char *path_name, tool_put_word_lh(hdr + 7, 1); /* one trustee */ memset(reqpath, 0, sizeof(reqpath)); - path_struct_len = c32_build_handle_path_from_dos_path(reqpath, + path_struct_len = ncp_build_handle_path_from_dos_path(reqpath, (uint8)dir_handle, 0, 0, path_name); @@ -1705,7 +1705,7 @@ int ncp87_0a_add_trustee_rights(const char *path_name, memset(rep1, 0, sizeof(rep1)); memset(rawout, 0, sizeof(rawout)); - C32_NCP87_Raw5_Probe(handle_lo, handle_hi, + NCP_Raw5_Probe(handle_lo, handle_hi, hdr, 9, reqpath, reqpath_len, rep0, sizeof(rep0), @@ -1769,7 +1769,7 @@ int ncp87_05_find_trustee_rights(const char *path_name, if (!rights_out) return(1); - rc = c32_get_ncp_handle(&handle_lo, &handle_hi); + rc = ncp_get_requester_handle(&handle_lo, &handle_hi); if (rc) return(10 + rc); @@ -1786,7 +1786,7 @@ int ncp87_05_find_trustee_rights(const char *path_name, tool_put_word_lh(hdr + 3, 0x8006); /* SA_ALL: files/subdirs + system + hidden */ tool_put_dword_lh(hdr + 5, seq); /* search sequence, starts at zero */ - path_len = c32_build_handle_path_from_dos_path(path, + path_len = ncp_build_handle_path_from_dos_path(path, (uint8)dir_handle, 0, 0, path_name); @@ -1795,7 +1795,7 @@ int ncp87_05_find_trustee_rights(const char *path_name, memset(rep1, 0, sizeof(rep1)); memset(rawout, 0, sizeof(rawout)); - C32_NCP87_Raw5_Probe(handle_lo, handle_hi, + NCP_Raw5_Probe(handle_lo, handle_hi, hdr, 9, path, path_len, rep0, sizeof(rep0), @@ -1877,7 +1877,7 @@ int ncp87_0b_delete_trustee_rights(const char *path_name, if (handle_lo_out) *handle_lo_out = 0; if (handle_hi_out) *handle_hi_out = 0; - rc = c32_get_ncp_handle(&handle_lo, &handle_hi); + rc = ncp_get_requester_handle(&handle_lo, &handle_hi); if (rc) return(10 + rc); @@ -1888,7 +1888,7 @@ int ncp87_0b_delete_trustee_rights(const char *path_name, tool_put_word_lh(hdr + 3, 1); /* one trustee */ memset(reqpath, 0, sizeof(reqpath)); - path_struct_len = c32_build_handle_path_from_dos_path(reqpath, + path_struct_len = ncp_build_handle_path_from_dos_path(reqpath, (uint8)dir_handle, 0, 0, path_name); @@ -1905,7 +1905,7 @@ int ncp87_0b_delete_trustee_rights(const char *path_name, memset(rep1, 0, sizeof(rep1)); memset(rawout, 0, sizeof(rawout)); - C32_NCP87_Raw5_Probe(handle_lo, handle_hi, + NCP_Raw5_Probe(handle_lo, handle_hi, hdr, 5, reqpath, reqpath_len, rep0, sizeof(rep0), diff --git a/c32ncp.h b/c32ncp.h index 4c2a5ac..3b1da9a 100644 --- a/c32ncp.h +++ b/c32ncp.h @@ -28,29 +28,29 @@ #ifndef C32NCP_H #define C32NCP_H -UI c32_build_handle_path(uint8 *buf, uint8 dhandle, +UI ncp_build_handle_path(uint8 *buf, uint8 dhandle, uint16 dirbase, uint8 style, int count, const char *c1, const char *c2, const char *c3); -UI c32_build_handle_path_from_dos_path(uint8 *buf, uint8 dhandle, +UI ncp_build_handle_path_from_dos_path(uint8 *buf, uint8 dhandle, uint16 dirbase, uint8 style, const char *dospath); -int c32_get_ncp_handle(uint16 *handle_lo, uint16 *handle_hi); +int ncp_get_requester_handle(uint16 *handle_lo, uint16 *handle_hi); -typedef struct c32_nwfile_handle6 { +typedef struct ncp_file_handle6 { uint8 h[6]; -} C32_NWFILE_HANDLE6; +} NCP_FILE_HANDLE6; -#define C32_OC_MODE_OPEN 0x01 -#define C32_OC_MODE_TRUNCATE 0x02 -#define C32_OC_MODE_CREATE 0x08 +#define NCP_OC_MODE_OPEN 0x01 +#define NCP_OC_MODE_TRUNCATE 0x02 +#define NCP_OC_MODE_CREATE 0x08 -#define C32_DAR_READ 0x0001 -#define C32_DAR_WRITE 0x0002 -#define C32_DAR_DENY_READ 0x0004 -#define C32_DAR_DENY_WRITE 0x0008 -#define C32_DAR_COMPAT 0x0010 +#define NCP_DAR_READ 0x0001 +#define NCP_DAR_WRITE 0x0002 +#define NCP_DAR_DENY_READ 0x0004 +#define NCP_DAR_DENY_WRITE 0x0008 +#define NCP_DAR_COMPAT 0x0010 int ncp87_01_open_create_entry(const char *path_name, uint16 dir_handle, @@ -58,21 +58,21 @@ int ncp87_01_open_create_entry(const char *path_name, uint32 create_attrs, uint16 desired_access, uint16 search_attrs, - C32_NWFILE_HANDLE6 *handle_out, + NCP_FILE_HANDLE6 *handle_out, uint32 *file_size_out, uint8 *open_create_action_out, uint16 *actual_out, uint16 *handle_lo_out, uint16 *handle_hi_out); -int ncp74_file_server_copy(const C32_NWFILE_HANDLE6 *src, - const C32_NWFILE_HANDLE6 *dst, +int ncp74_file_server_copy(const NCP_FILE_HANDLE6 *src, + const NCP_FILE_HANDLE6 *dst, uint32 src_offset, uint32 dst_offset, uint32 count, uint32 *copied_out); -int ncp66_close_file(const C32_NWFILE_HANDLE6 *handle); +int ncp66_close_file(const NCP_FILE_HANDLE6 *handle); int ncp87_06_obtain_rim_attributes(const char *name, @@ -83,7 +83,7 @@ int ncp87_06_obtain_rim_attributes(const char *name, uint16 *handle_hi_out); -typedef struct c32_dos_modify_info { +typedef struct ncp_dos_modify_info { uint32 attributes; uint16 creation_time; uint16 creation_date; @@ -97,9 +97,9 @@ typedef struct c32_dos_modify_info { uint32 archiver_id; uint16 inherited_rights; uint32 maximum_space; -} C32_DOS_MODIFY_INFO; +} NCP_DOS_MODIFY_INFO; -typedef struct c32_ndir_info { +typedef struct ncp_ndir_info { uint32 space_allocated; uint32 attributes; uint16 flags; @@ -126,11 +126,11 @@ typedef struct c32_ndir_info { uint32 ns_creator; uint8 name_len; char name[256]; -} C32_NDIR_INFO; +} NCP_NDIR_INFO; int ncp87_06_obtain_ndir_info(const char *path_name, uint16 dir_handle, - C32_NDIR_INFO *info_out, + NCP_NDIR_INFO *info_out, uint16 *actual_out, uint16 *handle_lo_out, uint16 *handle_hi_out); @@ -146,7 +146,7 @@ int ncp87_07_modify_dos_attributes(char *name, int ncp87_07_modify_dos_info(const char *name, uint16 dir_handle, uint32 change_mask, - C32_DOS_MODIFY_INFO *info, + NCP_DOS_MODIFY_INFO *info, uint16 *actual_out, uint16 *handle_lo_out, uint16 *handle_hi_out); diff --git a/creator.c b/creator.c index da2672c..55be176 100644 --- a/creator.c +++ b/creator.c @@ -419,7 +419,7 @@ static void creator_rights_string(uint16 rights, char *out) static int show_info(char *name, uint8 dhandle) { - C32_NDIR_INFO info; + NCP_NDIR_INFO info; int rc; char attr_text[24]; char rights_text[12]; diff --git a/kern.h b/kern.h index a75211f..7c86c64 100644 --- a/kern.h +++ b/kern.h @@ -39,9 +39,9 @@ extern void asm_esr_routine(void); extern void esr_routine(ECB *ecb); extern void KERN_CALL xmemmove(void *ziel, void *quelle, UI anz); extern int KERN_CALL Net_Call(UI func, void *req, void *repl); -extern int KERN_CALL C32_MapVar_Probe(UI specLen, UI flag, void *outbuf); -extern int KERN_CALL C32_OpenRef_Probe(UI refLo, UI refHi, void *outbuf); -extern int KERN_CALL C32_NCP87_Raw5_Probe(UI connLo, UI connHi, +extern int KERN_CALL NCP_MapVar_Probe(UI specLen, UI flag, void *outbuf); +extern int KERN_CALL NCP_OpenRef_Probe(UI refLo, UI refHi, void *outbuf); +extern int KERN_CALL NCP_Raw5_Probe(UI connLo, UI connHi, void *hdr, UI hdrLen, void *path, UI pathLen, void *rep0, UI rep0Len, diff --git a/kern_wasm.asm b/kern_wasm.asm index a5d9c20..da1dd4a 100644 --- a/kern_wasm.asm +++ b/kern_wasm.asm @@ -45,9 +45,9 @@ public _IPXclose_socket public _IPXlisten public _xmemmove public _Net_Call -public _C32_NCP87_Raw5_Probe -public _C32_OpenRef_Probe -public _C32_MapVar_Probe +public _NCP_Raw5_Probe +public _NCP_OpenRef_Probe +public _NCP_MapVar_Probe _IPXinit proc far push bp mov bp, sp @@ -242,7 +242,7 @@ _Net_Call endp -; int C32_OpenRef_Probe(UI refLo, UI refHi, void *outbuf) +; int NCP_OpenRef_Probe(UI refLo, UI refHi, void *outbuf) ; ; Opens a Client32 connection by connection reference using the same d32wrap ; convention as _CONNOpenByReference / w95ocref.o. @@ -262,7 +262,7 @@ _Net_Call endp ; +10 return DX ; +12 handle low ; +14 handle high -_C32_OpenRef_Probe proc far +_NCP_OpenRef_Probe proc far push bp mov bp, sp sub sp, 80 @@ -404,11 +404,11 @@ c32openref_store: c32openref_name db 'CONNOpenByReference',0 -_C32_OpenRef_Probe endp +_NCP_OpenRef_Probe endp -; int C32_MapVar_Probe(UI specLen, UI flag, void *outbuf) +; int NCP_MapVar_Probe(UI specLen, UI flag, void *outbuf) ; ; Exact-ish raw version of w95mconn.o::__C32MapConn16To32 second step. ; @@ -436,7 +436,7 @@ _C32_OpenRef_Probe endp ; +14 resultRef high ; +16 connRefLocal low ; corresponds to d32conni local -1c ; +18 connRefLocal high -_C32_MapVar_Probe proc far +_NCP_MapVar_Probe proc far push bp mov bp, sp sub sp, 140 @@ -691,21 +691,21 @@ c32mapvar_store: c32mapvar_name db 'CONNScanInfo',0 -_C32_MapVar_Probe endp +_NCP_MapVar_Probe endp -; int C32_NCP87_Raw5_Probe(UI connLo, UI connHi, +; int NCP_Raw5_Probe(UI connLo, UI connHi, ; void *hdr, UI hdrLen, ; void *path, UI pathLen, ; void *rep0, UI rep0Len, ; void *rep1, UI rep1Len, ; void *outbuf) ; -; Same as C32_NCP87_Raw_Probe but uses d32wrap-compatible 5-slot +; Same as NCP_Raw_Probe but uses d32wrap-compatible 5-slot ; fragment tables: 5 * 8 = 0x28 bytes for request and reply. -_C32_NCP87_Raw5_Probe proc far +_NCP_Raw5_Probe proc far push bp mov bp, sp sub sp, 180 @@ -983,7 +983,7 @@ raw5_store: raw5_name db 'COMPATNcpRequestReply',0 -_C32_NCP87_Raw5_Probe endp +_NCP_Raw5_Probe endp end diff --git a/ncopy.c b/ncopy.c index e4e93cf..3bafb23 100644 --- a/ncopy.c +++ b/ncopy.c @@ -114,7 +114,7 @@ static void ncopy_debug_ul(char *step, unsigned long value) } -static void ncopy_debug_handle6(char *step, C32_NWFILE_HANDLE6 *h) +static void ncopy_debug_handle6(char *step, NCP_FILE_HANDLE6 *h) { if (ncopy_debug_enabled() && h) { fprintf(stdout, @@ -383,11 +383,11 @@ static int ncopy_ncp74_copy_chunk(uint8 src_handle[6], uint8 dst_handle[6], uint32 src_offset, uint32 dst_offset, uint32 count, uint32 *copied); -static int ncopy_copy_data_c32_server(char *src, char *dst, unsigned long size) +static int ncopy_copy_data_ncp_server(char *src, char *dst, unsigned long size) { - C32_NWFILE_HANDLE6 sh; - C32_NWFILE_HANDLE6 dh; - C32_NDIR_INFO sinfo; + NCP_FILE_HANDLE6 sh; + NCP_FILE_HANDLE6 dh; + NCP_NDIR_INFO sinfo; char srcdir[260]; char srcname[80]; char dstdir[260]; @@ -440,9 +440,9 @@ static int ncopy_copy_data_c32_server(char *src, char *dst, unsigned long size) rc = ncp87_01_open_create_entry(srcname, src_dhandle, - C32_OC_MODE_OPEN, + NCP_OC_MODE_OPEN, 0, - C32_DAR_READ | C32_DAR_DENY_WRITE, + NCP_DAR_READ | NCP_DAR_DENY_WRITE, 0x8006, &sh, NULL, @@ -459,11 +459,11 @@ static int ncopy_copy_data_c32_server(char *src, char *dst, unsigned long size) rc = ncp87_01_open_create_entry(dstname, dst_dhandle, - C32_OC_MODE_OPEN | - C32_OC_MODE_TRUNCATE | - C32_OC_MODE_CREATE, + NCP_OC_MODE_OPEN | + NCP_OC_MODE_TRUNCATE | + NCP_OC_MODE_CREATE, create_attrs, - C32_DAR_WRITE | C32_DAR_DENY_READ, + NCP_DAR_WRITE | NCP_DAR_DENY_READ, 0x8006, &dh, NULL, @@ -720,7 +720,7 @@ static int ncopy_copy_data_direct_ncp87(char *src, char *dst, unsigned long size uint32 off = 0; uint32 todo; uint32 done; - C32_NDIR_INFO sinfo; + NCP_NDIR_INFO sinfo; char srcdir[260], srcname[80]; uint8 src_dhandle = 0; int src_allocated = 0; @@ -1321,7 +1321,7 @@ static void ncopy_restore_netware_attrs(char *src, char *dst, unsigned fallback_ uint8 dst_dhandle = 0; int src_allocated = 0; int dst_allocated = 0; - C32_NDIR_INFO sinfo; + NCP_NDIR_INFO sinfo; uint32 attrs; int rc; diff --git a/ncpcall.c b/ncpcall.c index 46d2022..8adca3f 100644 --- a/ncpcall.c +++ b/ncpcall.c @@ -33,7 +33,7 @@ /* Client32/Raw5 requester transport helpers used by the NCP API wrappers. */ /* - * c32_build_handle_path + * ncp_build_handle_path * * Purpose: * Builds the Client32-compatible NWHandlePathStruct used by NCP87 request @@ -46,7 +46,7 @@ * Returns: * Number of bytes used by the path structure. */ -UI c32_build_handle_path(uint8 *buf, uint8 dhandle, +UI ncp_build_handle_path(uint8 *buf, uint8 dhandle, uint16 dirbase, uint8 style, int count, const char *c1, const char *c2, const char *c3) @@ -116,7 +116,7 @@ UI c32_build_handle_path(uint8 *buf, uint8 dhandle, /* - * c32_build_handle_path_from_dos_path + * ncp_build_handle_path_from_dos_path * * Purpose: * Converts a DOS-style path string into the Client32-compatible @@ -126,7 +126,7 @@ UI c32_build_handle_path(uint8 *buf, uint8 dhandle, * Drive prefixes, leading slashes and simple current-directory components * are skipped so tool callers can pass ordinary DOS paths. */ -UI c32_build_handle_path_from_dos_path(uint8 *buf, uint8 dhandle, +UI ncp_build_handle_path_from_dos_path(uint8 *buf, uint8 dhandle, uint16 dirbase, uint8 style, const char *dospath) { @@ -207,28 +207,28 @@ UI c32_build_handle_path_from_dos_path(uint8 *buf, uint8 dhandle, /* * Current verified Client32 path for mars-nwe DOS utilities: * - * C32_MapVar_Probe(4,0) -> connRefLocal FFFF:FFFE - * C32_OpenRef_Probe(connRefLocal) -> Client32 handle, e.g. 0101:0001 + * NCP_MapVar_Probe(4,0) -> connRefLocal FFFF:FFFE + * NCP_OpenRef_Probe(connRefLocal) -> Client32 handle, e.g. 0101:0001 * - * C32_MapVar_Probe currently contains the confirmed Mars server-name scan + * NCP_MapVar_Probe currently contains the confirmed Mars server-name scan * shape. It is intentionally kept small and isolated here so FLAG and later * tools do not carry the old exploratory tests. */ /* - * c32_get_ncp_handle + * ncp_get_requester_handle * * Purpose: * Resolves the active MARS/NetWare connection into the Client32 NCP handle * used by the Raw5 requester probe. * * Requester path: - * C32_MapVar_Probe followed by C32_OpenRef_Probe. + * NCP_MapVar_Probe followed by NCP_OpenRef_Probe. * * Returns: * 0 on success. Non-zero values indicate that the connection reference or * Client32 NCP handle could not be obtained. */ -int c32_get_ncp_handle(uint16 *handle_lo, uint16 *handle_hi) +int ncp_get_requester_handle(uint16 *handle_lo, uint16 *handle_hi) { uint8 mapout[32]; uint8 openout[32]; @@ -243,7 +243,7 @@ int c32_get_ncp_handle(uint16 *handle_lo, uint16 *handle_hi) *handle_hi = 0; memset(mapout, 0, sizeof(mapout)); - C32_MapVar_Probe(4, 0, mapout); + NCP_MapVar_Probe(4, 0, mapout); map_ret_ax = tool_get_word_lh(mapout + 14); map_ret_dx = tool_get_word_lh(mapout + 16); @@ -254,7 +254,7 @@ int c32_get_ncp_handle(uint16 *handle_lo, uint16 *handle_hi) return(2); memset(openout, 0, sizeof(openout)); - C32_OpenRef_Probe(cref_lo, cref_hi, openout); + NCP_OpenRef_Probe(cref_lo, cref_hi, openout); open_ret_ax = tool_get_word_lh(openout + 14); open_ret_dx = tool_get_word_lh(openout + 16); diff --git a/ndir.c b/ndir.c index 953f819..fe70c0e 100644 --- a/ndir.c +++ b/ndir.c @@ -558,7 +558,7 @@ static int ndir_ncp22_scan_entry(char *name, int want_dir, uint32 *attrs) return(0); } -static int ndir_get_ncp_info(char *path, C32_NDIR_INFO *info) +static int ndir_get_ncp_info(char *path, NCP_NDIR_INFO *info) { uint8 connid = 0; uint8 dhandle = 0; @@ -579,7 +579,7 @@ static int ndir_get_ncp_info(char *path, C32_NDIR_INFO *info) static void ndir_inherited_rights(char *path, char *out) { - C32_NDIR_INFO info; + NCP_NDIR_INFO info; strcpy(out, "--------"); @@ -709,7 +709,7 @@ static void ndir_print_dir(char *dir, NDIR_FIND_ENTRY *ent, int options, char eff[10]; char inh[10]; char owner[50]; - C32_NDIR_INFO info; + NCP_NDIR_INFO info; tool_join_path(path, dir, ent->ff.name, sizeof(path)); if (!ndir_get_ncp_info(path, &info)) { @@ -731,7 +731,7 @@ static void ndir_print_dir(char *dir, NDIR_FIND_ENTRY *ent, int options, static void ndir_fill_entry_info(char *dir, NDIR_FIND_ENTRY *ent) { char path[260]; - C32_NDIR_INFO info; + NCP_NDIR_INFO info; int have_ncp22_attrs; ent->attrs = (uint32)ent->ff.attrib; diff --git a/nwtests.c b/nwtests.c index 27712e1..2abbe55 100644 --- a/nwtests.c +++ b/nwtests.c @@ -1066,9 +1066,9 @@ static void tests_print_dos_date(char *label, uint16 date) static int tests_ncp2225time(char *path, char *date_arg, char *time_arg) { uint8 dhandle = 0; - C32_NDIR_INFO before; - C32_NDIR_INFO after; - C32_NDIR_INFO restored; + NCP_NDIR_INFO before; + NCP_NDIR_INFO after; + NCP_NDIR_INFO restored; uint16 target_date = 0x5c99; /* 2026-05-25 */ uint16 target_time = 0xa320; /* 20:25:00 */ int rc; @@ -1163,9 +1163,9 @@ static int tests_ncp2225time(char *path, char *date_arg, char *time_arg) static int tests_ncp2225adate(char *path, char *date_arg) { uint8 dhandle = 0; - C32_NDIR_INFO before; - C32_NDIR_INFO after; - C32_NDIR_INFO restored; + NCP_NDIR_INFO before; + NCP_NDIR_INFO after; + NCP_NDIR_INFO restored; uint16 target_date = 0x5c99; /* 2026-04-25 */ int rc; int restore = 1; @@ -1317,9 +1317,9 @@ static int tests_ncp2225maxspace(char *path, char *space_arg) static int tests_ncp2225modid(char *path, char *id_arg) { uint8 dhandle = 0; - C32_NDIR_INFO before; - C32_NDIR_INFO after; - C32_NDIR_INFO restored; + NCP_NDIR_INFO before; + NCP_NDIR_INFO after; + NCP_NDIR_INFO restored; uint32 target_id = 0x00010003UL; int rc; int restore = 1; @@ -1403,9 +1403,9 @@ static int tests_ncp2225modid(char *path, char *id_arg) static int tests_ncp2225create(char *path, char *date_arg, char *time_arg, char *id_arg) { uint8 dhandle = 0; - C32_NDIR_INFO before; - C32_NDIR_INFO after; - C32_NDIR_INFO restored; + NCP_NDIR_INFO before; + NCP_NDIR_INFO after; + NCP_NDIR_INFO restored; uint16 target_date = 0x5c99; /* 2026-04-25 */ uint16 target_time = 0xa320; /* 20:25:00 */ uint32 target_id = 1; @@ -1513,9 +1513,9 @@ static int tests_ncp2225create(char *path, char *date_arg, char *time_arg, char static int tests_ncp2225arch(char *path, char *date_arg, char *time_arg, char *id_arg) { uint8 dhandle = 0; - C32_NDIR_INFO before; - C32_NDIR_INFO after; - C32_NDIR_INFO restored; + NCP_NDIR_INFO before; + NCP_NDIR_INFO after; + NCP_NDIR_INFO restored; uint16 target_date = 0x5c99; /* 2026-04-25 */ uint16 target_time = 0xa320; /* 20:25:00 */ uint32 target_id = 1; @@ -1830,7 +1830,7 @@ static int tests_ncp22rendir(char *parent) static int tests_read_irm_by_ncp87(uint8 dhandle, char *path, uint8 *mask_out) { - C32_NDIR_INFO info; + NCP_NDIR_INFO info; int rc; if (mask_out) @@ -2153,7 +2153,7 @@ static void tests_print_ncp22_1a_path(uint8 *data, uint16 len) static int tests_ncp23map(char *path) { uint8 dhandle = 0; - C32_NDIR_INFO info; + NCP_NDIR_INFO info; int rc; uint16 repl_len; uint8 repl_data[300]; @@ -2486,7 +2486,7 @@ static int tests_effright(char *path) char usepath[260]; int newhandle; uint16 ncp_rights = 0; - C32_NDIR_INFO info; + NCP_NDIR_INFO info; uint32 my_obj_id = 0; uint16 my_obj_type = 0; uint8 my_obj_name[48]; diff --git a/rights.c b/rights.c index 305da23..ac3514d 100644 --- a/rights.c +++ b/rights.c @@ -110,7 +110,7 @@ static void rights_ncp_path(char *dst, char *src, int max) } -static int rights_get_ncp_info(char *path, C32_NDIR_INFO *info) +static int rights_get_ncp_info(char *path, NCP_NDIR_INFO *info) { uint8 connid = 0; uint8 dhandle = 0; @@ -131,7 +131,7 @@ static int rights_get_ncp_info(char *path, C32_NDIR_INFO *info) static int rights_path_exists(char *path, int *is_dir) { - C32_NDIR_INFO info; + NCP_NDIR_INFO info; if (rights_get_ncp_info(path, &info)) return(0);