Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michael Bond
wine
Commits
1880a786
"README.md" did not exist on "d08f4fb5f56323630a32c5c81a0eaec076307fb9"
Commit
1880a786
authored
15 years ago
by
Nikolay Sivov
Committed by
Alexandre Julliard
15 years ago
Browse files
Options
Downloads
Patches
Plain Diff
ntdll: Make NtCreateFile and NtOpenFile thin wrappers over an internal function.
parent
475dcb81
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/ntdll/file.c
+66
-50
66 additions, 50 deletions
dlls/ntdll/file.c
with
66 additions
and
50 deletions
dlls/ntdll/file.c
+
66
−
50
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 *
*/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment