
/**
 * @file object_directory.h
 *
 * Tento soubor je soucasti frameworku pro praci s datovymi strukturami spravce objektu.
 * Jedna se o hlavickovy soubor k souboru object_directory.c, ktery implementuje funkce
 * pro praci s objekty adresaru v pojeti spravce objektu.
 */

#ifndef __OBJECT_DIRECTORY_H_
#define __OBJECT_DIRECTORY_H_

#include <ntddk.h>

// Definice internich struktur objektu adresare pro ruzne verze Windows
#include "object_directory_w2k.h"
#include "object_directory_wxp.h"
#include "object_directory_w2k3.h"
#include "object_directory_vista.h"
#include "object_directory_w7.h"

// Struktura prvku v hashovaci tabulce s polozkami adresare
typedef struct _DIRECTORY_ENTRY {
  // Dalsi prvek ve spojovem seznamu
  struct _DIRECTORY_ENTRY *Next;
  // Adresa tela objektu polozky
  PVOID Object;
} DIRECTORY_ENTRY, *PDIRECTORY_ENTRY;

// Popis jednotlivych funkci a procedur naleznete u jejich implementace v souboru
// object_directory.c.

PDIRECTORY_ENTRY *DOObjectHashBuckets(PVOID Object);
PVOID DORootDirectory(VOID);
POBJECT_TYPE DODirectoryTypeObject(VOID);
VOID DODirObjectLockShared(PVOID DirectoryObject);
VOID DODirObjectUnlockShared(PVOID DirectoryObject);
VOID DODirObjectLockExclusive(PVOID DirectoryObject);
VOID DODirObjectUnlockExclusive(PVOID DirectoryObject);
BOOLEAN DOIsDirectory(PVOID Object);
NTSTATUS DOGetDirectoryInfo(PVOID Object, PWCHAR *Buffer, PULONG32 BufferLength);

NTSTATUS DirObjectInit(PDRIVER_OBJECT DriverObject);
VOID DirObjectFinit(VOID);


#endif
