| Автор
| Сообщение |
 NikotiN
Розовый мамонт

Возраст: 26
Знак зодиака: 
Зарегистрирован: 18.03.2005
Сообщения: 2137
|
|
|
Цитата |
|
| нужно узнать имя файла, а в распоряжении имеется только результат CreateFile. Если быть конкретней, то нужно узнать в функции, которой передаётся TStream (ну или TFileStream) имя файла c которым работает поток. есть функция GetFileInformationByHandle, но там вроде нету имени/пути до файла. больше ничего не нашёл. возможно ли вообще получить имя файла? |
|
| В начало |
|
 |
|
|
 |
 NikotiN
Розовый мамонт

Возраст: 26
Знак зодиака: 
Зарегистрирован: 18.03.2005
Сообщения: 2137
|
|
|
Цитата |
|
ладно, наводящий вопрос:
объясните значение параметров фуекции
---
ZwQueryInformationFile
The ZwQueryInformationFile routine returns various kinds of information about a given file object.
NTSTATUS
ZwQueryInformationFile(
IN HANDLE FileHandle,
OUT PIO_STATUS_BLOCK IoStatusBlock,
OUT PVOID FileInformation,
IN ULONG Length,
IN FILE_INFORMATION_CLASS FileInformationClass
);
Parameters
FileHandle
Handle to a file object. The handle is created by a successful call to ZwCreateFile or ZwOpenFile.
IoStatusBlock
Pointer to a variable that receives the final completion status and information about the operation.
FileInformation
Pointer to a caller-allocated buffer or variable that receives the desired information about the file. The contents of FileInformation are defined by the FileInformationClass parameter, described later.
Length
Specifies the size in bytes of FileInformation, which the caller should set according to the given FileInformationClass.
FileInformationClass
Specifies the type of information to be returned about the file, in the buffer specified by FileInformation. Device and intermediate drivers, can specify any of the following.
---
как понимаю FileInformationClass - константа? а где взять значения? в msdn описаны только названия (FileAlignmentInformation, FileAttributeTagInformation....). |
|
| В начало |
|
 |
DrPass
Знающий :) /Почетный Модератор/

Возраст: 31
Знак зодиака: 
Зарегистрирован: 02.05.2002
Сообщения: 5709
Откуда: Донецк
|
|
|
Цитата |
|
Из справки по Native API -
FileDirectoryInformation =1,//1 Y N D
FileFullDirectoryInformation,//2 Y N D
FileBothDirectoryInformation,//3 Y N D
FileBasicInformation,//4 Y Y F
FileStandardInformation,//5 Y N F
FileInternalInformation,//6 Y N F
FileEaInformation,//7 Y N F
FileAccessInformation,//8 Y N F
FileNameInformation,//9 Y N F
FileRenameInformation,//10 N Y F
FileLinkInformation,//11 N Y F
FileNamesInformation,//12 Y N D
FileDispositionInformation,//13 N Y F
FilePositionInformation,//14 Y Y F
FileModeInformation =16,//16 Y Y F
FileAlignmentInformation,//17 Y N F
FileAllInformation,//18 Y N F
FileAllocationInformation,//19 N Y F
FileEndOfFileInformation,//20 N Y F
FileAlternateNameInformation,//21 Y N F
FileStreamInformation,//22 Y N F
FilePipeInformation,//23 Y Y F
FilePipeLocalInformation,//24 Y N F
FilePipeRemoteInformation,//25 Y Y F
FileMailslotQueryInformation,//26 Y N F
FileMailslotSetInformation,//27 N Y F
FileCompressionInformation,//28 Y N F
FileObjectIdInformation,//29 Y Y F
FileCompletionInformation,//30 N Y F
FileMoveClusterInformation,//31 N Y F
FileQuotaInformation,//32 Y Y F
FileReparsePointInformation,//33 Y N F
FileNetworkOpenInformation,//34 Y N F
FileAttributeTagInformation,//35 Y N F
FileTrackingInformation //36 N Y F _________________ Да пребудет с вами Сила! |
|
| В начало |
|
 |
|
|
|
Цитата |
|
HANDLE CreateFile(
LPCTSTR lpFileName, // pointer to name of the file
DWORD dwDesiredAccess, // access (read-write) mode
DWORD dwShareMode, // share mode
LPSECURITY_ATTRIBUTES lpSecurityAttributes, // pointer to security attributes
DWORD dwCreationDistribution, // how to create
DWORD dwFlagsAndAttributes, // file attributes
HANDLE hTemplateFile // handle to file with attributes to copy
);
Мне вот, интересно, как ты узнаешь хэндл файла, если для его создания требуется ввести lpFileName? |
|
| В начало |
|
 |
 NikotiN
Розовый мамонт

Возраст: 26
Знак зодиака: 
Зарегистрирован: 18.03.2005
Сообщения: 2137
|
|
|
Цитата |
|
| ты гляжу шибко умный? тогда подумай какую глупость ты сморозил. |
|
| В начало |
|
 |
DrPass
Знающий :) /Почетный Модератор/

Возраст: 31
Знак зодиака: 
Зарегистрирован: 02.05.2002
Сообщения: 5709
Откуда: Донецк
|
|
|
Цитата |
|
| Цитата: | | ты гляжу шибко умный? |
Спокойнее, уважаемый. Если кто неправ - исправь. Но понтов, пожалста, поменьше. Для взаимного обсирания есть "мастера Delphi" _________________ Да пребудет с вами Сила! |
|
| В начало |
|
 |
|
|
| В начало |
|
 |
|
|
|
Цитата |
|
| The requested URL /articles/master/009/SI_RE_t3.htm was not found on this server. |
|
| В начало |
|
 |
|