This note records how early Windows tracked the lifetime of kernel objects.
Windows was written in C, which has no notion of objects, so the kernel built its own. Early Windows had an object manager responsible for defining object types, naming objects, and handing out handles to users. Threads, processes, files, and semaphores were all object types.
Each object carried two counts. The handle count is the number of handles users hold on the object. The ref count is the number of references to the object within the kernel, and it includes the handles. The kernel-side count prevents premature deallocation. An object can only be freed once its ref count reaches zero, so kernel code that is still using an object keeps it alive even after the user closes every handle.
This is a stub from lecture. It stops before covering how handles resolve to objects through per-process handle tables.