This specification defines the common interface for DLL modules used by SHIORI, SAORI, and other Ukagaka systems.
All arguments and return values are passed using Windows Global Memory. Specifically, processing follows these steps:
Notes:
extern "C" __declspec(dllexport) HGLOBAL __cdecl request(HGLOBAL h, long *len);
All requests are made through a single function called request. The request function is the primary interface of a Ukagaka module and handles all requests from the baseware.
The request data format is designed with reference to HTTP and SSTP header formats and follows these rules:
The following functions are called when the DLL is loaded and unloaded.
extern "C" __declspec(dllexport) BOOL __cdecl loadu(HGLOBAL h, long len);
This function initializes the module.
The global memory in the first argument contains the module's directory path in UTF-8 encoding.
It was implemented in SSP 2.6.92 (2025/1/16). Earlier versions implement only load.
Example operations:
Notes:
extern "C" __declspec(dllexport) BOOL __cdecl load(HGLOBAL h, long len);
The legacy version of the loadu function.
It has the same specification as loadu, except that the module directory path in the first argument is encoded in the default OEM codepage (CP932 in Japanese environments).
Notes:
extern "C" __declspec(dllexport) BOOL __cdecl unload();
This function performs module shutdown. It is called by the baseware when the module is unloaded.
Operations to implement:
The return value is not currently used, but returning TRUE is recommended for future extensibility.
load / request / unload support only one instance per DLL. For baseware that needs to create multiple instances from the same DLL in one process, the following functions, which distinguish instances by id, can optionally be implemented. The module remains valid without them and works as before with baseware that does not call them.
extern "C" __declspec(dllexport) long __cdecl multi_loadu(HGLOBAL h, long len);
extern "C" __declspec(dllexport) long __cdecl multi_load(HGLOBAL h, long len);
extern "C" __declspec(dllexport) BOOL __cdecl multi_unload(long id);
extern "C" __declspec(dllexport) HGLOBAL __cdecl multi_request(long id, HGLOBAL h, long *len);
loadu / load. The module directory path encoding also follows loadu (UTF-8) and load (the default OEM codepage), respectively. The return value is an id identifying the instance (an integer of 1 or greater); returning -1 on failure is recommended. Baseware treats return values of 0 or less as failure. As with loadu / load, the module frees the memoryrequest to the instance identified by id. Returns NULL if the id does not existNotes:
load / request / unload. multi_load* must not return 0multi_load* returns an id even if dictionary loading fails (just as load always returns TRUE; use CI_check_failed to check for failure)The following functions are implemented independently by YAYA (yaya.dll). They are used to work with debugging check tools and are not part of the SHIORI specification. Other modules do not need to implement them, and baseware does not need to call them.
Note
The specification may change to suit YAYA's needs. Like the multi-instance functions in the previous section, functions prefixed with multi_ operate on the instance identified by id.
extern "C" __declspec(dllexport) BOOL __cdecl CI_check_failed(void);
extern "C" __declspec(dllexport) BOOL __cdecl multi_CI_check_failed(long id);
Returns TRUE when dictionary loading has failed and operation is suppressed, or when the module is in emergency mode. Returns FALSE for a nonexistent id (in the multi_ version) or before load.
extern "C" __declspec(dllexport) void __cdecl Set_loghandler(void (*loghandler)(const wchar_t *str, int mode, int id));
extern "C" __declspec(dllexport) void __cdecl multi_Set_loghandler(long id, void (*loghandler)(const wchar_t *str, int mode, int id));
Registers a callback function to receive YAYA logs. Registration enables log output. The multi_ version can only register a callback for an instance created by multi_load* and does nothing for a nonexistent id.
The callback arguments are as follows.
mode is a control valueThe values of mode are as follows.
The callback is called on the thread that called load / request / unload.
extern "C" __declspec(dllexport) BOOL __cdecl logsend(long hwnd);
Available only in the Windows DLL version. Pass the handle (HWND) of the window that receives logs via WM_COPYDATA. Always returns TRUE. If a callback is registered with Set_loghandler, it takes precedence.
WM_COPYDATA has the same value as the mode of Set_loghandler in dwData, and the log string (UTF-16, NUL-terminated) in lpData.