From c6a477d6ae765f1b43b108edd1a47fa8952e54a8 Mon Sep 17 00:00:00 2001 From: Test Date: Tue, 2 Jun 2026 16:16:47 +0000 Subject: [PATCH] docs: audit direct semaphore stubs --- AI.md | 19 ++++++++++++++- TODO.md | 38 +++++++++++++++++++++++++++-- src/nwconn.c | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 123 insertions(+), 3 deletions(-) diff --git a/AI.md b/AI.md index be92b42..8307290 100644 --- a/AI.md +++ b/AI.md @@ -547,7 +547,7 @@ long-name-space family, or another unaudited top-level family such as AFP bindery/property/admin subfunction coverage, unless the user requests a specific family first. -The next patch number should be `0214` if `0213` was applied. +The next patch number should follow the latest applied patch; after patch `0223`, use `0224`. Retro source-stub checkpoint from patch 0207: @@ -589,3 +589,20 @@ with documented 1.x/2.x calls, and the current forward plan is only through provider/out-of-scope reason, and no active behavior change. Disabled stubs must not use misleading control flow such as `return(-1)` where that return value has no local handoff meaning. + + +Latest endpoint audit checkpoint from patch 0223: + +- Direct `NCP 0x2222/111` / wire `0x6f` Semaphore is now source-stub-audited + in `src/nwconn.c`. There is no active top-level handler for this newer + NetWare 3.x/4.x semaphore family. +- Patch `0223` records disabled `#if 0` selector slots for `111/00` + Open/Create a Semaphore, `111/01` Examine Semaphore, `111/02` Wait On (P) + Semaphore, `111/03` Signal (V) Semaphore, and `111/04` Close Semaphore. +- The old `32/xx` semaphore implementation in `src/sema.c` remains the active + compatibility path. Future work should bridge both families through one + semaphore provider/state table and verify the documented Lo-Hi handle order + against existing MARS-NWE big-endian handle helpers before changing behavior. +- This block is local synchronization, not `nwnds`/directory work. + +Next patch number should be `0224`. diff --git a/TODO.md b/TODO.md index 8be3de7..5347404 100644 --- a/TODO.md +++ b/TODO.md @@ -206,6 +206,11 @@ Present in the code but not yet fully endpoint-audited: planned NetWare-4.x/NDS work. The top-level source case remains active as unsupported (`0xfb`), while the documented 104/01..104/08 selector slots are recorded behind `#if MARS_NWE_4` in `src/nwconn.c`. +- SDK `0x2222/111` / wire `0x6f` Semaphore is source-stub-audited as + the newer NetWare 3.x/4.x paired semaphore family. The old `32/xx` + semaphore calls remain the active compatibility implementation; patch 0223 + records `111/00`..`111/04` as disabled `#if 0` selector slots in + `src/nwconn.c` so the future semaphore provider can bridge both families. - SDK `0x2222/17` / wire `0x11` direct Print/Spool is source-stub-audited as a NetWare 2.x/3.x/4.x compatibility family. There is no active top-level handler for these legacy direct spool NCPs, so patch 0218 records @@ -570,8 +575,37 @@ Known differences / follow-up: - `Wait On Semaphore` currently does not sleep until `SemaphoreTimeOut`; the simple emulator returns timeout immediately when the semaphore value is not available. -- Newer SDK `0x2222/111` semaphore calls are the modern paired variants and are - not routed through this compatibility handler. +- Newer SDK `0x2222/111` semaphore calls are the modern paired variants. + They are now source-stub-audited separately at the direct wire `0x6f` + dispatch slot; any future implementation should bridge to a shared + semaphore provider rather than duplicating the old `32/xx` implementation. + + + +#### Direct semaphore group 0x2222/111 + +Current status: + +- Direct `NCP 0x2222/111` / wire `0x6f` is source-stub-audited in + `src/nwconn.c`. There is no active top-level handler for this newer + NetWare 3.x/4.x paired semaphore family. +- The documented selector slots are recorded in a disabled `#if 0` block: + - `111/00` Open/Create a Semaphore + - `111/01` Examine Semaphore + - `111/02` Wait On (P) Semaphore + - `111/03` Signal (V) Semaphore + - `111/04` Close Semaphore +- The old `32/xx` semaphore group remains the active compatibility path. + Future implementation should decode the `111/xx` wrapper and share the + same semaphore provider/state rather than building a second semaphore table. + +Known differences / follow-up: + +- The NDK documents `SemaphoreHandle` as long Lo-Hi for both old `32/xx` and + newer `111/xx` families. The active old handler currently uses big-endian + helpers for handles; verify client traces before bridging the new family. +- This remains local semaphore/synchronization state. It does not belong to + `nwnds`, `nwdirectory`, or the future directory store. #### Direct connection lifecycle and buffer-size calls diff --git a/src/nwconn.c b/src/nwconn.c index b2bc604..0a7f6cb 100644 --- a/src/nwconn.c +++ b/src/nwconn.c @@ -7282,6 +7282,75 @@ static int handle_ncp_serv(void) break; } + +#if 0 + case 0x6f : { /* SDK 111 / wire 0x6f Semaphore group. + * Source outcome: no active top-level handler exists. + * Stub scope: NetWare 3.x/4.x compatibility. The old + * 2.x/3.x SDK 32 / wire 0x20 semaphore group is already + * implemented in sema.c; SDK 111 is the newer paired + * function family documented separately by the NDK. + * Request handoff: requestdata[0] is the SDK 111 + * SubFunctionCode. The documented selectors are: + * 111/00 Open/Create a Semaphore + * 111/01 Examine Semaphore + * 111/02 Wait On (P) Semaphore + * 111/03 Signal (V) Semaphore + * 111/04 Close Semaphore + * Future owner: semaphore provider. This remains local + * synchronization state, not nwnds/directory state. + */ + switch ((requestlen > (int)sizeof(NCPREQUEST)) + ? (int)requestdata[0] : -1) { + case 0x00: /* Open/Create a Semaphore. + * Request: InitialSemaphoreValue byte, + * SemaphoreNameLen byte, SemaphoreName. + * Reply: SemaphoreHandle long Lo-Hi, + * SemaphoreOpenCount byte. + * Possible bridge: decode the SDK 111 wrapper + * and call the existing SDK 32 old-semaphore + * implementation once byte-order compatibility + * is verified. + */ + completition = 0xfb; + break; + case 0x01: /* Examine Semaphore. + * Request: SemaphoreHandle long Lo-Hi. + * Reply: SemaphoreValue byte, + * SemaphoreOpenCount byte. + */ + completition = 0xfb; + break; + case 0x02: /* Wait On (P) Semaphore. + * Request: SemaphoreHandle long Lo-Hi, + * SemaphoreTimeOut word Hi-Lo. + * Reply: no payload; Completion is success, + * timeout, or lock error. The old 32/02 shim + * currently returns timeout immediately when + * unavailable; a future shared provider should + * document whether it preserves that behavior. + */ + completition = 0xfb; + break; + case 0x03: /* Signal (V) Semaphore. + * Request: SemaphoreHandle long Lo-Hi. + * Reply: no payload, normal Completion. + */ + completition = 0xfb; + break; + case 0x04: /* Close Semaphore. + * Request: SemaphoreHandle long Lo-Hi. + * Reply: no payload, normal Completion. + */ + completition = 0xfb; + break; + default: completition = 0xfb; + break; + } + } + break; +#endif + default : completition = 0xfb; /* unknown request */ break;