-/* $Id: objdir.c,v 1.11 2003/06/07 16:16:38 chorns Exp $
+/* $Id: objdir.c,v 1.12 2003/09/03 20:16:06 ekohl Exp $
*
* DESCRIPTION: Object Manager Simple Explorer
* PROGRAMMER: David Welch
OBJECT_ATTRIBUTES ObjectAttributes;
NTSTATUS Status;
HANDLE DirectoryHandle;
- BYTE DirectoryEntry [MAX_DIR_ENTRY * sizeof(OBJDIR_INFORMATION)];
- POBJDIR_INFORMATION pDirectoryEntry = (POBJDIR_INFORMATION) DirectoryEntry;
+ BYTE DirectoryEntry [MAX_DIR_ENTRY * sizeof(DIRECTORY_BASIC_INFORMATION)];
+ PDIRECTORY_BASIC_INFORMATION pDirectoryEntry = (PDIRECTORY_BASIC_INFORMATION) DirectoryEntry;
ULONG Context = 0;
ULONG ReturnLength = 0;
ULONG EntryCount = 0;
*/
if (FALSE != Recurse)
{
- pDirectoryEntry = (POBJDIR_INFORMATION) DirectoryEntry;
+ pDirectoryEntry = (PDIRECTORY_BASIC_INFORMATION) DirectoryEntry;
while (0 != pDirectoryEntry->ObjectTypeName.Length)
{
if (0 == wcscmp (L"Directory", pDirectoryEntry->ObjectTypeName.Buffer))
-/* $Id: zw.h,v 1.15 2003/08/19 23:59:08 dwelch Exp $
+/* $Id: zw.h,v 1.16 2003/09/03 20:14:22 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
/*
* FUNCTION: Query information about the content of a directory object
* ARGUMENTS:
- DirObjInformation = Buffer must be large enough to hold the name strings too
- GetNextIndex = If TRUE :return the index of the next object in this directory in ObjectIndex
- If FALSE: return the number of objects in this directory in ObjectIndex
- IgnoreInputIndex= If TRUE: ignore input value of ObjectIndex always start at index 0
- If FALSE use input value of ObjectIndex
- ObjectIndex = zero based index of object in the directory depends on GetNextIndex and IgnoreInputIndex
- DataWritten = Actual size of the ObjectIndex ???
+ DirectoryHandle =
+ Buffer = Buffer must be large enough to hold the name strings too
+ ReturnSingleEntry = If TRUE :return the index of the next object in this directory in ObjectIndex
+ If FALSE: return the number of objects in this directory in ObjectIndex
+ RestartScan = If TRUE: ignore input value of ObjectIndex always start at index 0
+ If FALSE use input value of ObjectIndex
+ Context = zero based index of object in the directory depends on GetNextIndex and IgnoreInputIndex
+ ReturnLength = Actual size of the ObjectIndex ???
* RETURNS: Status
*/
NTSTATUS
STDCALL
NtQueryDirectoryObject(
- IN HANDLE DirObjHandle,
- OUT POBJDIR_INFORMATION DirObjInformation,
- IN ULONG BufferLength,
- IN BOOLEAN GetNextIndex,
- IN BOOLEAN IgnoreInputIndex,
- IN OUT PULONG ObjectIndex,
- OUT PULONG DataWritten OPTIONAL
+ IN HANDLE DirectoryHandle,
+ OUT PVOID Buffer,
+ IN ULONG BufferLength,
+ IN BOOLEAN ReturnSingleEntry,
+ IN BOOLEAN RestartScan,
+ IN OUT PULONG Context,
+ OUT PULONG ReturnLength OPTIONAL
);
/*
/*
* FUNCTION: Query information about the content of a directory object
* ARGUMENTS:
- DirObjInformation = Buffer must be large enough to hold the name strings too
- GetNextIndex = If TRUE :return the index of the next object in this directory in ObjectIndex
- If FALSE: return the number of objects in this directory in ObjectIndex
- IgnoreInputIndex= If TRUE: ignore input value of ObjectIndex always start at index 0
- If FALSE use input value of ObjectIndex
- ObjectIndex = zero based index of object in the directory depends on GetNextIndex and IgnoreInputIndex
- DataWritten = Actual size of the ObjectIndex ???
+ DirectoryHandle =
+ Buffer = Buffer must be large enough to hold the name strings too
+ ReturnSingleEntry = If TRUE :return the index of the next object in this directory in ObjectIndex
+ If FALSE: return the number of objects in this directory in ObjectIndex
+ RestartScan = If TRUE: ignore input value of ObjectIndex always start at index 0
+ If FALSE use input value of ObjectIndex
+ Context = zero based index of object in the directory depends on GetNextIndex and IgnoreInputIndex
+ ReturnLength = Actual size of the ObjectIndex ???
* RETURNS: Status
*/
NTSTATUS
STDCALL
ZwQueryDirectoryObject(
- IN HANDLE DirObjHandle,
- OUT POBJDIR_INFORMATION DirObjInformation,
- IN ULONG BufferLength,
- IN BOOLEAN GetNextIndex,
- IN BOOLEAN IgnoreInputIndex,
- IN OUT PULONG ObjectIndex,
- OUT PULONG DataWritten OPTIONAL
+ IN HANDLE DirectoryHandle,
+ OUT PVOID Buffer,
+ IN ULONG BufferLength,
+ IN BOOLEAN ReturnSingleEntry,
+ IN BOOLEAN RestartScan,
+ IN OUT PULONG Context,
+ OUT PULONG ReturnLength OPTIONAL
);
/*
// directory information
-typedef struct _OBJDIR_INFORMATION {
+typedef struct _DIRECTORY_BASIC_INFORMATION
+{
UNICODE_STRING ObjectName;
UNICODE_STRING ObjectTypeName; // Directory, Device ...
- UCHAR Data[0];
-} OBJDIR_INFORMATION, *POBJDIR_INFORMATION;
+} DIRECTORY_BASIC_INFORMATION, *PDIRECTORY_BASIC_INFORMATION;
/*
-/* $Id: dirobj.c,v 1.18 2003/06/07 12:23:14 chorns Exp $
+/* $Id: dirobj.c,v 1.19 2003/09/03 20:15:02 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* Reads information from a directory in the system namespace.
*
* ARGUMENTS
- * DirObjHandle
+ * DirectoryHandle
* Handle, obtained with NtOpenDirectoryObject(), which
* must grant DIRECTORY_QUERY access to the directory
* object.
*
- * DirObjInformation (OUT)
+ * Buffer (OUT)
* Buffer to hold the data read.
*
* BufferLength
* If FALSE start reading at the index specified
* by object index *ObjectIndex.
*
- * ObjectIndex
+ * Context
* Zero based index into the directory, interpretation
* depends on RestartScan.
*
- * DataWritten (OUT)
+ * ReturnLength (OUT)
* Caller supplied storage for the number of bytes
* written (or NULL).
*
* Mostly rewritten.
*/
NTSTATUS STDCALL
-NtQueryDirectoryObject (IN HANDLE DirObjHandle,
- OUT POBJDIR_INFORMATION DirObjInformation,
+NtQueryDirectoryObject (IN HANDLE DirectoryHandle,
+ OUT PVOID Buffer,
IN ULONG BufferLength,
IN BOOLEAN ReturnSingleEntry,
IN BOOLEAN RestartScan,
- IN OUT PULONG ObjectIndex,
- OUT PULONG DataWritten OPTIONAL)
+ IN OUT PULONG Context,
+ OUT PULONG ReturnLength OPTIONAL)
{
PDIRECTORY_OBJECT dir = NULL;
PLIST_ENTRY current_entry = NULL;
POBJECT_HEADER current = NULL;
ULONG i = 0;
NTSTATUS Status = STATUS_SUCCESS;
- DWORD DirectoryCount = 0;
- DWORD DirectorySize = 0;
+ ULONG DirectoryCount = 0;
+ ULONG DirectorySize = 0;
ULONG SpaceLeft = BufferLength;
ULONG SpaceRequired = 0;
ULONG NameLength = 0;
ULONG TypeNameLength = 0;
- POBJDIR_INFORMATION current_odi = DirObjInformation;
- PBYTE FirstFree = (PBYTE) DirObjInformation;
+ PDIRECTORY_BASIC_INFORMATION current_odi = (PDIRECTORY_BASIC_INFORMATION) Buffer;
+ PUCHAR FirstFree = (PUCHAR) Buffer;
DPRINT("NtQueryDirectoryObject(DirObjHandle %x)\n", DirObjHandle);
* on user params. */
/* Reference the DIRECTORY_OBJECT */
- Status = ObReferenceObjectByHandle(DirObjHandle,
+ Status = ObReferenceObjectByHandle(DirectoryHandle,
DIRECTORY_QUERY,
ObDirectoryType,
UserMode,
{
return (Status);
}
- /* Check ObjectIndex is not NULL */
- if (NULL == ObjectIndex)
+ /* Check Context is not NULL */
+ if (NULL == Context)
{
return (STATUS_INVALID_PARAMETER);
}
DirectoryCount = 1;
}
// count is DirectoryCount + one null entry
- DirectorySize = (DirectoryCount + 1) * sizeof (OBJDIR_INFORMATION);
+ DirectorySize = (DirectoryCount + 1) * sizeof (DIRECTORY_BASIC_INFORMATION);
if (DirectorySize > SpaceLeft)
{
return (STATUS_BUFFER_TOO_SMALL);
if (FALSE == RestartScan)
{
/* RestartScan == FALSE */
- register ULONG EntriesToSkip = *ObjectIndex;
+ register ULONG EntriesToSkip = *Context;
CHECKPOINT;
} while (FALSE == ReturnSingleEntry);
/*
- * Store current index in ObjectIndex
+ * Store current index in Context
*/
- *ObjectIndex += DirectoryCount;
+ *Context += DirectoryCount;
/*
* Report to the caller how much bytes
* we wrote in the user buffer.
*/
- if (NULL != DataWritten)
+ if (NULL != ReturnLength)
{
- *DataWritten = (BufferLength - SpaceLeft);
+ *ReturnLength = (BufferLength - SpaceLeft);
}
return (STATUS_SUCCESS);
}
-/* $Id: database.c,v 1.9 2003/08/28 13:38:24 gvg Exp $
+/* $Id: database.c,v 1.10 2003/09/03 20:15:35 ekohl Exp $
*
* service control manager
*
UNICODE_STRING DirName;
HANDLE DirHandle;
NTSTATUS Status;
- POBJDIR_INFORMATION DirInfo;
+ PDIRECTORY_BASIC_INFORMATION DirInfo;
ULONG BufferLength;
ULONG DataLength;
ULONG Index;
return(Status);
}
- BufferLength = sizeof(OBJDIR_INFORMATION) +
+ BufferLength = sizeof(DIRECTORY_BASIC_INFORMATION) +
2 * MAX_PATH * sizeof(WCHAR);
DirInfo = HeapAlloc(GetProcessHeap(),
HEAP_ZERO_MEMORY,