From: SMTP%"maxim@brm.com" 7-JAN-1998 17:57:39.99 To: "'ntfsd@atria.com'" CC: Subj: [ntfsd] Access denied for ZwCreateFile() Return-Path: owner-ntfsd@atria.com Received: by arisia.gce.com (UCX V4.1-12C, OpenVMS V7.1 VAX); Wed, 7 Jan 1998 17:55:48 -0500 Received: from gw.atria.com (gw.atria.com [192.88.237.2]) by mercury.mv.net (8.8.8/mem-971025) with SMTP id PAA12311 for ; Wed, 7 Jan 1998 15:14:06 -0500 (EST) Received: by gw.atria.com id Wed, 7 Jan 1998 11:47:12 -0500 Received: from brm_nt.brm.co.il by gw.atria.com id Wed, 7 Jan 1998 11:46:53 -0500 Received: by BRM_NT with Internet Mail Service (5.0.1457.3) id ; Wed, 7 Jan 1998 18:52:05 +0200 Message-ID: From: Maxim Tseitlin To: "'ntfsd@atria.com'" Subject: [ntfsd] Access denied for ZwCreateFile() Date: Wed, 7 Jan 1998 18:52:00 +0200 X-Priority: 3 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.0.1457.3) Content-Type: text/plain Sender: owner-ntfsd@atria.com Precedence: bulk X-Majordomo-Taboo: ntfsd I'm attempting to read a file on a file server from my kernel device driver by using the ZwCreateFile() function. This always results in STATUS_ACCESS_DENIED. I AM able to read a file successfully from a local disk drive. I assume that my device driver needs to get proper access permissions before it accesses files on network, but how can this be done? Here is a piece of my code that calls ZwCreateFile(): // --------------------------- NTSTATUS ntStatus; IO_STATUS_BLOCK IoStatus; HANDLE NtFileHandle; OBJECT_ATTRIBUTES ObjectAttributes; UNICODE_STRING FullFileName; //char szName[] = "\\??\\C:\\Autoexec.bat"; // SUCCEEDS //char szName[] = "\\??\\L:\\AUTORUN.INF"; // Drive L is mapped to an NT file server --> STATUS_ACCESS_DENIED char szName[] = "\\??\\H:\\PKZIP.EXE"; // Drive H is mapped to a Netware 3.12 file server --> STATUS_ACCESS_DENIED FILE_STANDARD_INFORMATION StandardInfo; ntStatus = charUnicode(szName, &FullFileName); if (!NT_SUCCESS(ntStatus)) { return ntStatus; } InitializeObjectAttributes ( &ObjectAttributes, &FullFileName, OBJ_CASE_INSENSITIVE, NULL, NULL ); ntStatus = ZwCreateFile( &NtFileHandle, SYNCHRONIZE | FILE_READ_DATA, &ObjectAttributes, &IoStatus, NULL, FILE_ATTRIBUTE_NORMAL, FILE_SHARE_READ, FILE_OPEN, FILE_SYNCHRONOUS_IO_NONALERT, NULL, 0 ); if ( !NT_SUCCESS( ntStatus ) ) { DbgPrint("ZwCF: Error opening file %x\n", ntStatus); return nStatus; } // ---------------------------- Thanks in advance for any help. Maxim Tseitlin MediaPath Technologies - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [ To unsubscribe, send email to ntfsd-request@atria.com with body UNSUBSCRIBE (the subject is ignored). ]