static NWCCODE ncp_log_physical_record32(NWCONN_HANDLE conn, const char fh[6], u_int32_t startOffset, u_int32_t length, unsigned int flags, unsigned int timeout) { NWCCODE err; ncp_init_request(conn); ncp_add_byte(conn, flags); ncp_add_mem(conn, fh, 6); ncp_add_dword_hl(conn, startOffset); ncp_add_dword_hl(conn, length); ncp_add_word_hl(conn, timeout); err = ncp_request(conn, 109); ncp_unlock_conn(conn); return err; }
static NWCCODE ncp_clear_release_physical_record32(NWCONN_HANDLE conn, const char fh[6], u_int32_t startOffset, u_int32_t length, int release) { NWCCODE err; ncp_init_request(conn); ncp_add_mem(conn, fh, 6); ncp_add_dword_hl(conn, startOffset); ncp_add_dword_hl(conn, length); if (release) { err = ncp_request(conn, 28); } else { err = ncp_request(conn, 30); } ncp_unlock_conn(conn); return err; }
static NWCCODE ncp_log_physical_record64(NWCONN_HANDLE conn, u_int32_t fh, ncp_off64_t startOffset, u_int64_t length, unsigned int flags, unsigned int timeout) { NWCCODE err; ncp_init_request(conn); ncp_add_byte(conn, 67); ncp_add_dword_lh(conn, flags); ncp_add_dword_lh(conn, fh); ncp_add_qword_hl(conn, startOffset); ncp_add_qword_hl(conn, length); ncp_add_dword_hl(conn, timeout); err = ncp_request(conn, 87); ncp_unlock_conn(conn); return err; }
int ncp_get_bindery_object_name(NWCONN_HANDLE connid, u_int32_t object_id, struct ncp_bindery_object *target) { int error; DECLARE_RQ; ncp_init_request_s(conn, 54); ncp_add_dword_hl(conn, object_id); if ((error = ncp_request(connid, 23, conn)) != 0) return error; target->object_id = ncp_reply_dword_hl(conn, 0); target->object_type = ncp_reply_word_hl(conn, 4); memcpy(target->object_name, ncp_reply_data(conn, 6), 48); return 0; }
int ncp_scan_bindery_object(NWCONN_HANDLE connid, u_int32_t last_id, u_int16_t object_type, const char *search_string, struct ncp_bindery_object *target) { int error; DECLARE_RQ; ncp_init_request_s(conn, 55); ncp_add_dword_hl(conn, last_id); ncp_add_word_hl(conn, object_type); ncp_add_pstring(conn, search_string); error = ncp_request(connid, 23, conn); if (error) return error; target->object_id = ncp_reply_dword_hl(conn, 0); target->object_type = ncp_reply_word_hl(conn, 4); memcpy(target->object_name, ncp_reply_data(conn, 6),NCP_BINDERY_NAME_LEN); target->object_flags = ncp_reply_byte(conn, 54); target->object_security = ncp_reply_byte(conn, 55); target->object_has_prop = ncp_reply_byte(conn, 56); return 0; }