hi all, I found this structure called OBJECT_ATTRIBUTE in one of the nt dll functions..I was curious to know about that structure and I went through its documentation(msdn)...In the OBJECT_ATTRIBUTE structure there is a parameter called PUNICODE_STRING objectName...As per the msdn documentation..it says that the objectName "the name of the object for which a handle is to be opened" which is actually a name or some root directory,am confused with this.Can anybody explain this term "name of the object"(root directory).what it represents.
+1
A:
This structure is used by device drivers and other kernel mode code to specify attributes of file objects. When you open a file with the NtOpenFile or IoCreateFile functions, you have to pass an OBJECT_ATTRIBUTES
with the name of the file.
The ObjectName
member of the structure is simply a pointer to an UNICODE_STRING
structure containing the file or directory name.
Lorenzo
2010-06-03 10:31:33
I guess this isnt related to myquestion..my question is all about a i/p parameter called(PUNICODE_STRING objectName) of OBJECT_ATTRIBUTE.
kiddo
2010-06-03 11:32:24
It is related indeed. If you want to open a file with NtOpenFile, you have to pass to that function a pointer to an OBJECT_ATTRIBUTE structure, with its member ObjectName pointing to an UNICODE_STRING structure containing the file or directory name.
Lorenzo
2010-06-03 12:29:19
thank you for your assistance..
kiddo
2010-06-03 12:52:55
you're welcome!
Lorenzo
2010-06-03 13:11:41