Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
1880a786
Commit
1880a786
authored
Jun 05, 2009
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jun 05, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Make NtCreateFile and NtOpenFile thin wrappers over an internal function.
parent
475dcb81
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
50 deletions
+66
-50
file.c
dlls/ntdll/file.c
+66
-50
No files found.
dlls/ntdll/file.c
View file @
1880a786
...
...
@@ -90,60 +90,17 @@ mode_t FILE_umask = 0;
#define SECSPERDAY 86400
#define SECS_1601_TO_1970 ((369 * 365 + 89) * (ULONGLONG)SECSPERDAY)
/**************************************************************************
* NtOpenFile [NTDLL.@]
* ZwOpenFile [NTDLL.@]
*
* Open a file.
*
* PARAMS
* handle [O] Variable that receives the file handle on return
* access [I] Access desired by the caller to the file
* attr [I] Structure describing the file to be opened
* io [O] Receives details about the result of the operation
* sharing [I] Type of shared access the caller requires
* options [I] Options for the file open
*
* RETURNS
* Success: 0. FileHandle and IoStatusBlock are updated.
* Failure: An NTSTATUS error code describing the error.
*/
NTSTATUS
WINAPI
NtOpenFile
(
PHANDLE
handle
,
ACCESS_MASK
access
,
POBJECT_ATTRIBUTES
attr
,
PIO_STATUS_BLOCK
io
,
ULONG
sharing
,
ULONG
options
)
{
return
NtCreateFile
(
handle
,
access
,
attr
,
io
,
NULL
,
0
,
sharing
,
FILE_OPEN
,
options
,
NULL
,
0
);
}
/**************************************************************************
* NtCreateFile [NTDLL.@]
* ZwCreateFile [NTDLL.@]
*
* Either create a new file or directory, or open an existing file, device,
* directory or volume.
*
* PARAMS
* handle [O] Points to a variable which receives the file handle on return
* access [I] Desired access to the file
* attr [I] Structure describing the file
* io [O] Receives information about the operation on return
* alloc_size [I] Initial size of the file in bytes
* attributes [I] Attributes to create the file with
* sharing [I] Type of shared access the caller would like to the file
* disposition [I] Specifies what to do, depending on whether the file already exists
* options [I] Options for creating a new file
* ea_buffer [I] Pointer to an extended attributes buffer
* ea_length [I] Length of ea_buffer
* FILE_CreateFile (internal)
* Open a file.
*
* RETURNS
* Success: 0. handle and io are updated.
* Failure: An NTSTATUS error code describing the error.
* Parameter set fully identical with NtCreateFile
*/
NTSTATUS
WINAPI
Nt
CreateFile
(
PHANDLE
handle
,
ACCESS_MASK
access
,
POBJECT_ATTRIBUTES
attr
,
PIO_STATUS_BLOCK
io
,
PLARGE_INTEGER
alloc_size
,
ULONG
attributes
,
ULONG
sharing
,
ULONG
disposition
,
ULONG
options
,
PVOID
ea_buffer
,
ULONG
ea_length
)
static
NTSTATUS
FILE_
CreateFile
(
PHANDLE
handle
,
ACCESS_MASK
access
,
POBJECT_ATTRIBUTES
attr
,
PIO_STATUS_BLOCK
io
,
PLARGE_INTEGER
alloc_size
,
ULONG
attributes
,
ULONG
sharing
,
ULONG
disposition
,
ULONG
options
,
PVOID
ea_buffer
,
ULONG
ea_length
)
{
ANSI_STRING
unix_name
;
int
created
=
FALSE
;
...
...
@@ -248,6 +205,65 @@ NTSTATUS WINAPI NtCreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATTRIB
return
io
->
u
.
Status
;
}
/**************************************************************************
* NtOpenFile [NTDLL.@]
* ZwOpenFile [NTDLL.@]
*
* Open a file.
*
* PARAMS
* handle [O] Variable that receives the file handle on return
* access [I] Access desired by the caller to the file
* attr [I] Structure describing the file to be opened
* io [O] Receives details about the result of the operation
* sharing [I] Type of shared access the caller requires
* options [I] Options for the file open
*
* RETURNS
* Success: 0. FileHandle and IoStatusBlock are updated.
* Failure: An NTSTATUS error code describing the error.
*/
NTSTATUS
WINAPI
NtOpenFile
(
PHANDLE
handle
,
ACCESS_MASK
access
,
POBJECT_ATTRIBUTES
attr
,
PIO_STATUS_BLOCK
io
,
ULONG
sharing
,
ULONG
options
)
{
return
FILE_CreateFile
(
handle
,
access
,
attr
,
io
,
NULL
,
0
,
sharing
,
FILE_OPEN
,
options
,
NULL
,
0
);
}
/**************************************************************************
* NtCreateFile [NTDLL.@]
* ZwCreateFile [NTDLL.@]
*
* Either create a new file or directory, or open an existing file, device,
* directory or volume.
*
* PARAMS
* handle [O] Points to a variable which receives the file handle on return
* access [I] Desired access to the file
* attr [I] Structure describing the file
* io [O] Receives information about the operation on return
* alloc_size [I] Initial size of the file in bytes
* attributes [I] Attributes to create the file with
* sharing [I] Type of shared access the caller would like to the file
* disposition [I] Specifies what to do, depending on whether the file already exists
* options [I] Options for creating a new file
* ea_buffer [I] Pointer to an extended attributes buffer
* ea_length [I] Length of ea_buffer
*
* RETURNS
* Success: 0. handle and io are updated.
* Failure: An NTSTATUS error code describing the error.
*/
NTSTATUS
WINAPI
NtCreateFile
(
PHANDLE
handle
,
ACCESS_MASK
access
,
POBJECT_ATTRIBUTES
attr
,
PIO_STATUS_BLOCK
io
,
PLARGE_INTEGER
alloc_size
,
ULONG
attributes
,
ULONG
sharing
,
ULONG
disposition
,
ULONG
options
,
PVOID
ea_buffer
,
ULONG
ea_length
)
{
return
FILE_CreateFile
(
handle
,
access
,
attr
,
io
,
alloc_size
,
attributes
,
sharing
,
disposition
,
options
,
ea_buffer
,
ea_length
);
}
/***********************************************************************
* Asynchronous file I/O *
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment