Hello,
I have next code to open named( already created ) pipe from my driver:
RtlInitUnicodeString( &fileName, L"\??\pipe\testpipe" );
//
// Initialize the object attributes and open the file.
//
InitializeObjectAttributes( &fName,
&fileName,
OBJ_KERNEL_HANDLE | OBJ_CASE_INSENSITIVE,
NULL,
NULL );
Result = ZwCreateFile( &g_AuditFileHandle
, GENERIC_WRITE | SYNCHRONIZE
, &fName
, &IoStatusBlock
, 0
, FILE_ATTRIBUTE_NORMAL
, 0
, FILE_OVERWRITE_IF
, FILE_SYNCHRONOUS_IO_ALERT | FILE_NO_INTERMEDIATE_BUFFERING |
FILE_WRITE_THROUGH
, NULL
, 0 );
The code works all right on all platforms starting from Windows 2000. For
backward compatibility I need this code to run on Windows NT 4.0 too; right
now the code fails on NT platform at ZwCreateFile with 0xC000000D error
code( invalid parameter ). Can someone tell me, please, what’s wrong with
the code in NT case?
Thanks,
Alex.
>Can someone tell me, please, what’s wrong with the code in NT case?
OBJ_KERNEL_HANDLE , the NT core uses a mask to check for valid parameters,
OBJ_KERNEL_HANDLE flag doesn’t exist in NT4.
–
Slava Imameyev, xxxxx@hotmail.com
“Alex Korthny” wrote in message news:xxxxx@ntfsd…
> Hello,
>
> I have next code to open named( already created ) pipe from my driver:
>
> RtlInitUnicodeString( &fileName, L"\??\pipe\testpipe" );
>
>
> //
>
> // Initialize the object attributes and open the file.
>
> //
>
>
> InitializeObjectAttributes( &fName,
>
> &fileName,
>
> OBJ_KERNEL_HANDLE | OBJ_CASE_INSENSITIVE,
>
> NULL,
>
> NULL );
>
>
> Result = ZwCreateFile( &g_AuditFileHandle
>
> , GENERIC_WRITE | SYNCHRONIZE
>
> , &fName
>
> , &IoStatusBlock
>
> , 0
>
> , FILE_ATTRIBUTE_NORMAL
>
> , 0
>
> , FILE_OVERWRITE_IF
>
> , FILE_SYNCHRONOUS_IO_ALERT | FILE_NO_INTERMEDIATE_BUFFERING |
> FILE_WRITE_THROUGH
>
> , NULL
>
> , 0 );
>
>
>
> The code works all right on all platforms starting from Windows 2000. For
> backward compatibility I need this code to run on Windows NT 4.0 too;
> right now the code fails on NT platform at ZwCreateFile with 0xC000000D
> error code( invalid parameter ). Can someone tell me, please, what’s wrong
> with the code in NT case?
>
>
>
> Thanks,
>
> Alex.
>
>
>
>
>
Thanks!
Now it works as intended.
“Slava Imameyev” wrote in message news:xxxxx@ntfsd…
> >Can someone tell me, please, what’s wrong with the code in NT case?
>
> OBJ_KERNEL_HANDLE , the NT core uses a mask to check for valid parameters,
> OBJ_KERNEL_HANDLE flag doesn’t exist in NT4.
>
> –
> Slava Imameyev, xxxxx@hotmail.com
>
>
> “Alex Korthny” wrote in message news:xxxxx@ntfsd…
>> Hello,
>>
>> I have next code to open named( already created ) pipe from my driver:
>>
>> RtlInitUnicodeString( &fileName, L"\??\pipe\testpipe" );
>>
>>
>> //
>>
>> // Initialize the object attributes and open the file.
>>
>> //
>>
>>
>> InitializeObjectAttributes( &fName,
>>
>> &fileName,
>>
>> OBJ_KERNEL_HANDLE | OBJ_CASE_INSENSITIVE,
>>
>> NULL,
>>
>> NULL );
>>
>>
>> Result = ZwCreateFile( &g_AuditFileHandle
>>
>> , GENERIC_WRITE | SYNCHRONIZE
>>
>> , &fName
>>
>> , &IoStatusBlock
>>
>> , 0
>>
>> , FILE_ATTRIBUTE_NORMAL
>>
>> , 0
>>
>> , FILE_OVERWRITE_IF
>>
>> , FILE_SYNCHRONOUS_IO_ALERT | FILE_NO_INTERMEDIATE_BUFFERING |
>> FILE_WRITE_THROUGH
>>
>> , NULL
>>
>> , 0 );
>>
>>
>>
>> The code works all right on all platforms starting from Windows 2000. For
>> backward compatibility I need this code to run on Windows NT 4.0 too;
>> right now the code fails on NT platform at ZwCreateFile with 0xC000000D
>> error code( invalid parameter ). Can someone tell me, please, what’s
>> wrong with the code in NT case?
>>
>>
>>
>> Thanks,
>>
>> Alex.
>>
>>
>>
>>
>>
>
>
>