From c10b07c15ef711fc62886465d63d139d5eb79fe2 Mon Sep 17 00:00:00 2001 From: OAI Date: Mon, 1 Jun 2026 22:40:09 +0000 Subject: [PATCH] docs: document ncp23 bindery object layouts --- TODO.md | 18 ++++++++++-- src/nwbind.c | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+), 3 deletions(-) diff --git a/TODO.md b/TODO.md index ec571b1..f4c1257 100644 --- a/TODO.md +++ b/TODO.md @@ -445,6 +445,13 @@ Current status: - SDK `23/26` / wire `0x1a` Get Internet Address - SDK `23/27` / wire `0x1b` Get Object Connection List - SDK `23/28` / wire `0x1c` Get Station's Logged Info + - SDK `23/50` / wire `0x32` Create Bindery Object + - SDK `23/51` / wire `0x33` Delete Bindery Object + - SDK `23/52` / wire `0x34` Rename Object + - SDK `23/53` / wire `0x35` Get Bindery Object ID + - SDK `23/54` / wire `0x36` Get Bindery Object Name + - SDK `23/55` / wire `0x37` Scan Bindery Object + - SDK `23/56` / wire `0x38` Change Bindery Object Security - SDK `23/15` request payload offsets match the current parser: `LastSearchIndex`, `DirectoryHandle`, `SearchAttributes`, `FileNameLen`, and `FileName`. The reply shape also matches the documented fixed file @@ -461,6 +468,11 @@ Current status: `NWGetFileServerInformation()`, `NWGetNetworkSerialNumber()`, `NWGetInternetAddress()`, `NWGetConnectionInformation()`, `NWGetObjectConnectionNumbers()`, and related connection/server headers. +- Bindery object calls SDK `23/50` through SDK `23/56` were compared against + the NDK/Core-Protocols PDF, WebSDK API names, and `nwbindry.h` prototypes. + The current `nwbind.c` parsers match the documented request payload order and + Hi-Lo object type/object ID fields. Replies for SDK `23/53`, `23/54`, and + `23/55` match the documented fixed bindery object reply blocks. Follow-up: @@ -480,9 +492,9 @@ Follow-up: - SDK `23/27` / wire `0x1b` documents `SearchConnNumber` and returned connection numbers as Lo-Hi long values; the current code reads the search number with `GET_BE32()` and returns 16-bit connection numbers. -- Audit the remaining forwarded `0x2222/23` bindery, queue, and management - subfunctions in the files that actually handle them instead of treating the - `nwconn.c` forwarding points as complete local implementations. +- Audit the remaining forwarded `0x2222/23` property, set, queue, and + management subfunctions in the files that actually handle them instead of + treating the `nwconn.c` forwarding points as complete local implementations. ### Extended volume information field mapping diff --git a/src/nwbind.c b/src/nwbind.c index 1b38aee..ed5f0c8 100644 --- a/src/nwbind.c +++ b/src/nwbind.c @@ -1297,6 +1297,18 @@ static void handle_fxx(int gelen, int func) case 0x32 : { /* Create Bindery Object */ + /* + * SDK 23/50 / wire 0x32 Create Bindery Object. + * Request payload after SubFunctionCode: + * byte StatusFlags + * byte SecurityLevel + * word ObjectType (Hi-Lo) + * byte ObjectNameLen + * byte ObjectName[ObjectNameLen] + * Parser comparison: field order and ObjectType byte + * order match the documented layout. The include-level + * cross-check is NWCreateObject() in nwbindry.h. + */ NETOBJ obj; int result; uint8 *p = rdata; @@ -1309,6 +1321,15 @@ static void handle_fxx(int gelen, int func) } break; case 0x33 : { /* delete OBJECT */ + /* + * SDK 23/51 / wire 0x33 Delete Bindery Object. + * Request payload after SubFunctionCode: + * word ObjectType (Hi-Lo) + * byte ObjectNameLen + * byte ObjectName[ObjectNameLen] + * Parser comparison: matches the documented layout. + * Include cross-check: NWDeleteObject() in nwbindry.h. + */ uint8 *p = rdata; int result; NETOBJ obj; @@ -1319,6 +1340,19 @@ static void handle_fxx(int gelen, int func) } break; case 0x34 : { /* rename OBJECT, only SU */ + /* + * SDK 23/52 / wire 0x34 Rename Object. + * Request payload after SubFunctionCode: + * word ObjectType (Hi-Lo) + * byte OldObjectNameLen + * byte OldObjectName[OldObjectNameLen] + * byte NewObjNameLen + * byte NewObjectName[NewObjNameLen] + * Parser comparison: matches the documented order. + * The implementation additionally enforces local SU + * rights before calling nw_rename_obj(). + * Include cross-check: NWRenameObject() in nwbindry.h. + */ int result=-0xff; if (act_c->id_flags&1) { uint8 *p = rdata; @@ -1335,6 +1369,17 @@ static void handle_fxx(int gelen, int func) case 0x35 : { /* get Bindery Object ID */ + /* + * SDK 23/53 / wire 0x35 Get Bindery Object ID. + * Request payload after SubFunctionCode: + * word ObjectType (Hi-Lo) + * byte ObjectNameLen + * byte ObjectName[ObjectNameLen] + * Reply: ObjectID (Hi-Lo), ObjectType (Hi-Lo), and + * ObjectName[48]. Parser/reply comparison matches the + * documented layout. + * Include cross-check: NWGetObjectID() in nwbindry.h. + */ struct XDATA { uint8 object_id[4]; uint8 object_type[2]; @@ -1356,6 +1401,15 @@ static void handle_fxx(int gelen, int func) } break; case 0x36 : { /* get Bindery Object Name */ + /* + * SDK 23/54 / wire 0x36 Get Bindery Object Name. + * Request payload after SubFunctionCode: + * long ObjectID (Hi-Lo) + * Reply: ObjectID (Hi-Lo), ObjectType (Hi-Lo), and + * ObjectName[48]. Parser/reply comparison matches the + * documented layout. + * Include cross-check: NWGetObjectName() in nwbindry.h. + */ struct XDATA { uint8 object_id[4]; uint8 object_type[2]; @@ -1375,6 +1429,18 @@ static void handle_fxx(int gelen, int func) } break; case 0x37 : { /* Scan Bindery Object */ + /* + * SDK 23/55 / wire 0x37 Scan Bindery Object. + * Request payload after SubFunctionCode: + * long LastObjectSeen (Hi-Lo) + * word SearchObjectType (Hi-Lo) + * byte SearchNameLen + * byte SearchObjectName[SearchNameLen] + * Reply includes ObjectID, ObjectType, ObjectName[48], + * ObjectFlags, ObjectSecurity, and ObjectHasProperties. + * Parser/reply comparison matches the documented layout. + * Include cross-check: NWScanObject() in nwbindry.h. + */ struct XDATA { uint8 object_id[4]; uint8 object_type[2]; @@ -1406,6 +1472,19 @@ static void handle_fxx(int gelen, int func) break; case 0x38 : { /* change Bindery Objekt Security */ + /* + * SDK 23/56 / wire 0x38 Change Bindery Object Security. + * Request payload after SubFunctionCode: + * byte NewSecurity + * word ObjectType (Hi-Lo) + * byte ObjectNameLen + * byte ObjectName[ObjectNameLen] + * Parser comparison: matches the documented layout. + * The implementation additionally enforces local SU + * rights before calling nw_change_obj_security(). + * Include cross-check: NWChangeObjectSecurity() in + * nwbindry.h. + */ /* only SU ! */ int result= -0xff; if (act_c->id_flags&1) {