s_stormLocksReady
global · storm
- Address
0xc5a170· 4 bytes, up to0xc5a173- Type
uint32_t- Meaning
- Holds 1 once InitStormLocks has made Storm's critical sections, 0 before it and after the shutdown
- Confidence
- verified, proof one
- Finding
- storm/log#closing-a-log
Finding: Closing a log in storm: text logs
SLogClose(id) (0x659ec0) does nothing until Storm's locks exist (s_stormLocksReady, 0xc5a170). It finds the
record with LockLog (0x659f70, create 0), which on a hit returns it with its bucket's lock held. A record with an
open file first runs FlushLog (0x659f10): buffered bytes go out with WriteFile, then FlushFileBuffers, and the
buffer empties. The file is then closed with CloseHandle. 0x65a060 unlinks the record from its bucket chain,
releases its 0x10124 bytes with VirtualFree and leaves the lock. The caller's own id word is not zeroed; the chat
teardown zeroes its words itself.
The derivation is in the doc.