Exemplo n.º 1
0
BOOLEAN PhIoSupportInitialization(
    VOID
    )
{
    PH_OBJECT_TYPE_PARAMETERS parameters;

    parameters.FreeListSize = sizeof(PH_FILE_STREAM);
    parameters.FreeListCount = 16;

    PhFileStreamType = PhCreateObjectTypeEx(L"FileStream", PH_OBJECT_TYPE_USE_FREE_LIST, PhpFileStreamDeleteProcedure, &parameters);

    return TRUE;
}
Exemplo n.º 2
0
/**
 * Creates an object type.
 *
 * \param ObjectType A variable which receives a pointer to the newly
 * created object type.
 * \param Name The name of the type.
 * \param Flags A combination of flags affecting the behaviour of the
 * object type.
 * \param DeleteProcedure A callback function that is executed when
 * an object of this type is about to be freed (i.e. when its
 * reference count is 0).
 *
 * \remarks Do not reference or dereference the object type once it
 * is created.
 */
NTSTATUS PhCreateObjectType(
    __out PPH_OBJECT_TYPE *ObjectType,
    __in PWSTR Name,
    __in ULONG Flags,
    __in_opt PPH_TYPE_DELETE_PROCEDURE DeleteProcedure
    )
{
    return PhCreateObjectTypeEx(
        ObjectType,
        Name,
        Flags,
        DeleteProcedure,
        NULL
        );
}