Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 16 additions & 15 deletions sdk-api-src/content/fileapi/nf-fileapi-createfilew.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ The name of the file or device to be created or opened. You may use either forwa


For information on special device names, see
<a href="/windows/desktop/FileIO/defining-an-ms-dos-device-name">Defining an MS-DOS Device Name</a>.
<a href="/windows/win32/fileio/defining-an-ms-dos-device-name">Defining an MS-DOS Device Name</a>.

To create a file stream, specify the name of the file, a colon, and then the name of the stream. For more
information, see <a href="/windows/desktop/FileIO/file-streams">File Streams</a>.
information, see <a href="/windows/win32/fileio/file-streams">File Streams</a>.

By default, the name is limited to MAX_PATH characters. To extend this limit to 32,767 wide characters, prepend "\\\\?\\" to the path. For more information, see [Naming Files, Paths, and Namespaces](/windows/win32/fileio/naming-a-file).

Expand All @@ -91,7 +91,7 @@ By default, the name is limited to MAX_PATH characters. To extend this limit to

### -param dwDesiredAccess [in]

The requested access to the file or device, which can be summarized as read, write, both or neither zero).
The requested access to the file or device, which can be summarized as read, write, both or neither (zero).

The most commonly used values are <b>GENERIC_READ</b>,
<b>GENERIC_WRITE</b>, or both
Expand Down Expand Up @@ -983,7 +983,7 @@ If you rename or delete a file and then restore it shortly afterward, the system
information to restore. Cached information includes its short/long name pair and creation time.

If you call <b>CreateFile</b> on a file that is pending deletion
as a result of a previous call to <a href="/windows/desktop/api/fileapi/nf-fileapi-deletefilea">DeleteFile</a>, the function
as a result of a previous call to <a href="/windows/desktop/api/fileapi/nf-fileapi-deletefilew">DeleteFile</a>, the function
fails. The operating system delays file deletion until all handles to the file are closed.
<a href="/windows/desktop/api/errhandlingapi/nf-errhandlingapi-getlasterror">GetLastError</a> returns
<b>ERROR_ACCESS_DENIED</b>.
Expand Down Expand Up @@ -1032,8 +1032,8 @@ An application cannot create a directory by using
<b>CreateFile</b>, therefore only the
<b>OPEN_EXISTING</b> value is valid for
<i>dwCreationDisposition</i> for this use case. To create a directory, the application must
call <a href="/windows/desktop/api/fileapi/nf-fileapi-createdirectorya">CreateDirectory</a> or
<a href="/windows/desktop/api/winbase/nf-winbase-createdirectoryexa">CreateDirectoryEx</a>.
call <a href="/windows/desktop/api/fileapi/nf-fileapi-createdirectoryw">CreateDirectory</a> or
<a href="/windows/desktop/api/winbase/nf-winbase-createdirectoryexw">CreateDirectoryEx</a>.

To open a directory using <b>CreateFile</b>, specify the
<b>FILE_FLAG_BACKUP_SEMANTICS</b> flag as part of
Expand Down Expand Up @@ -1334,9 +1334,9 @@ If <b>CreateFile</b> opens the client end of a named pipe, the
the handle as many times as required, but after it is opened, the named pipe instance cannot be opened by
another client. The access that is specified when a pipe is opened must be compatible with the access that is
specified in the <i>dwOpenMode</i> parameter of the
<a href="/windows/desktop/api/winbase/nf-winbase-createnamedpipea">CreateNamedPipe</a> function.
<a href="/windows/desktop/api/winbase/nf-winbase-createnamedpipew">CreateNamedPipe</a> function.

If the <a href="/windows/desktop/api/winbase/nf-winbase-createnamedpipea">CreateNamedPipe</a> function was not
If the <a href="/windows/desktop/api/winbase/nf-winbase-createnamedpipew">CreateNamedPipe</a> function was not
successfully called on the server prior to this operation, a pipe will not exist and
<b>CreateFile</b> will fail with
<b>ERROR_FILE_NOT_FOUND</b>.
Expand Down Expand Up @@ -1464,31 +1464,31 @@ A tape backup code snippet can found at



<a href="/windows/desktop/api/fileapi/nf-fileapi-createdirectorya">CreateDirectory</a>
<a href="/windows/desktop/api/fileapi/nf-fileapi-createdirectoryw">CreateDirectory</a>



<a href="/windows/desktop/api/winbase/nf-winbase-createdirectoryexa">CreateDirectoryEx</a>
<a href="/windows/desktop/api/winbase/nf-winbase-createdirectoryexw">CreateDirectoryEx</a>



<a href="/windows/desktop/api/winbase/nf-winbase-createfiletransacteda">CreateFileTransacted</a>
<a href="/windows/desktop/api/winbase/nf-winbase-createfiletransactedw">CreateFileTransacted</a>



<a href="/windows/desktop/api/winbase/nf-winbase-createmailslota">CreateMailSlot</a>
<a href="/windows/desktop/api/winbase/nf-winbase-createmailslotw">CreateMailSlot</a>



<a href="/windows/desktop/api/winbase/nf-winbase-createnamedpipea">CreateNamedPipe</a>
<a href="/windows/desktop/api/winbase/nf-winbase-createnamedpipew">CreateNamedPipe</a>



<a href="/windows/desktop/FileIO/creating--deleting--and-maintaining-files">Creating, Deleting, and Maintaining Files</a>



<a href="/windows/desktop/api/fileapi/nf-fileapi-deletefilea">DeleteFile</a>
<a href="/windows/desktop/api/fileapi/nf-fileapi-deletefilew">DeleteFile</a>



Expand Down Expand Up @@ -1564,7 +1564,7 @@ A tape backup code snippet can found at



<a href="/windows/desktop/api/fileapi/nf-fileapi-setfileattributesa">SetFileAttributes</a>
<a href="/windows/desktop/api/fileapi/nf-fileapi-setfileattributesw">SetFileAttributes</a>



Expand All @@ -1573,3 +1573,4 @@ A tape backup code snippet can found at


<a href="/windows/desktop/api/fileapi/nf-fileapi-writefileex">WriteFileEx</a>

11 changes: 6 additions & 5 deletions sdk-api-src/content/fileapi/nf-fileapi-deletefilew.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ The following list identifies some tips for deleting, removing, or closing files
- To delete a read-only file, first you must remove the read-only attribute.
- To delete or rename a file, you must have either delete permission on the file, or delete child permission in the parent directory.
- To recursively delete the files in a directory, use the [SHFileOperation](/windows/win32/api/shellapi/nf-shellapi-shfileoperationw) function.
- To remove an empty directory, use the [RemoveDirectory](nf-fileapi-removedirectoryw.md) function.
- To remove an empty directory, use the [RemoveDirectory](/windows/win32/api/fileapi/nf-fileapi-removedirectoryw) function.
- To close an open file, use the [CloseHandle](/windows/win32/api/handleapi/nf-handleapi-closehandle) function.

If you set up a directory with all access except delete and delete child, and the access control lists (ACL) of new files are inherited, then you can create a file without being able to delete it. However, then you can create a file, and then get all the access you request on the handle that is returned to you at the time you create the file.
Expand All @@ -100,13 +100,13 @@ If you request delete permission at the time you create a file, you can delete o

The **DeleteFile** function fails if an application attempts to delete a file that has other handles open for normal I/O or as a memory-mapped file (**FILE_SHARE_DELETE** must have been specified when other handles were opened).

The **DeleteFile** function marks a file for deletion on close. Therefore, the file deletion does not occur until the last handle to the file is closed. Subsequent calls to [CreateFile](nf-fileapi-createfilew.md) to open the file fail with **ERROR_ACCESS_DENIED**.
The **DeleteFile** function marks a file for deletion on close. Therefore, the file deletion does not occur until the last handle to the file is closed. Subsequent calls to [CreateFile](/windows/win32/api/fileapi/nf-fileapi-createfilew) to open the file fail with **ERROR_ACCESS_DENIED**.

The use of POSIX delete causes the file to be deleted while handles remain open. Subsequent calls to [CreateFile](nf-fileapi-createfilew.md) to open the file fail with **ERROR_FILE_NOT_FOUND**.
The use of POSIX delete causes the file to be deleted while handles remain open. Subsequent calls to [CreateFile]/windows/win32/api/fileapi/nf-fileapi-createfilew) to open the file fail with **ERROR_FILE_NOT_FOUND**.

Symbolic link behavior:

If the path points to a symbolic link, the symbolic link is deleted, not the target. To delete a target, you must call [CreateFile](nf-fileapi-createfilew.md) and specify **FILE_FLAG_DELETE_ON_CLOSE**.
If the path points to a symbolic link, the symbolic link is deleted, not the target. To delete a target, you must call [CreateFile](/windows/win32/api/fileapi/nf-fileapi-createfilew) and specify **FILE_FLAG_DELETE_ON_CLOSE**.

In Windows 8 and Windows Server 2012, this function is supported by the following technologies:

Expand All @@ -129,10 +129,11 @@ For an example, see [Locking and Unlocking Byte Ranges in Files](/windows/win32/

[CloseHandle](/windows/win32/api/handleapi/nf-handleapi-closehandle)

[CreateFile](nf-fileapi-createfilew.md)
[CreateFile](/windows/win32/api/fileapi/nf-fileapi-createfilew)

[DeleteFileTransacted](/windows/win32/api/winbase/nf-winbase-deletefiletransactedw)

[File Management Functions](/windows/win32/FileIO/file-management-functions)

[Symbolic Links](/windows/win32/FileIO/symbolic-links)

3 changes: 2 additions & 1 deletion sdk-api-src/content/fileapi/nf-fileapi-findfirstfilew.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ By default, the name is limited to MAX_PATH characters. To extend this limit to

### -param lpFindFileData [out]

A pointer to the <a href="/windows/desktop/api/minwinbase/ns-minwinbase-win32_find_dataa">WIN32_FIND_DATA</a> structure that
A pointer to the <a href="/windows/desktop/api/minwinbase/ns-minwinbase-win32_find_dataw">WIN32_FIND_DATA</a> structure that
receives information about a found file or directory.

## -returns
Expand Down Expand Up @@ -338,3 +338,4 @@ For another example, see


<a href="/windows/desktop/api/minwinbase/ns-minwinbase-win32_find_dataw">WIN32_FIND_DATA</a>

3 changes: 2 additions & 1 deletion sdk-api-src/content/fileapi/nf-fileapi-writefile.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ int main()
// ... Add code using bufferAligned here.

// Replace with corresponding free routine.
delete buffer;
delete[] buffer;
}

```
Expand Down Expand Up @@ -280,3 +280,4 @@ int main()
[SetEndOfFile](nf-fileapi-setendoffile.md)

[WriteFileEx](nf-fileapi-writefileex.md)

16 changes: 8 additions & 8 deletions sdk-api-src/content/minwinbase/ns-minwinbase-win32_find_dataw.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ api_name:
## -description

Contains information about the file that is found by the
<a href="/windows/desktop/api/fileapi/nf-fileapi-findfirstfilea">FindFirstFile</a>,
<a href="/windows/desktop/api/fileapi/nf-fileapi-findfirstfileexa">FindFirstFileEx</a>, or
<a href="/windows/desktop/api/fileapi/nf-fileapi-findnextfilea">FindNextFile</a> function.
<a href="/windows/desktop/api/fileapi/nf-fileapi-findfirstfilew">FindFirstFile</a>,
<a href="/windows/desktop/api/fileapi/nf-fileapi-findfirstfileexw">FindFirstFileEx</a>, or
<a href="/windows/desktop/api/fileapi/nf-fileapi-findnextfilew">FindNextFile</a> function.

## -struct-fields

Expand Down Expand Up @@ -226,11 +226,11 @@ typedef struct _WIN32_FIND_DATAW {
If a file has a long file name, the complete name appears in the <b>cFileName</b> member,
and the 8.3 format truncated version of the name appears in the <b>cAlternateFileName</b>
member. Otherwise, <b>cAlternateFileName</b> is empty. If the
<a href="/windows/desktop/api/fileapi/nf-fileapi-findfirstfileexa">FindFirstFileEx</a> function was called with a value of
<a href="/windows/desktop/api/fileapi/nf-fileapi-findfirstfileexw">FindFirstFileEx</a> function was called with a value of
<b>FindExInfoBasic</b> in the <i>fInfoLevelId</i> parameter, the
<b>cAlternateFileName</b> member will always contain a <b>NULL</b> string
value. This remains true for all subsequent calls to the
<a href="/windows/desktop/api/fileapi/nf-fileapi-findnextfilea">FindNextFile</a> function. As an alternative method of
<a href="/windows/desktop/api/fileapi/nf-fileapi-findnextfilew">FindNextFile</a> function. As an alternative method of
retrieving the 8.3 format version of a file name, you can use the
<a href="/windows/desktop/api/fileapi/nf-fileapi-getshortpathnamew">GetShortPathName</a> function. For more information about
file names, see <a href="/windows/desktop/FileIO/naming-a-file">File Names, Paths, and Namespaces</a>.
Expand Down Expand Up @@ -274,15 +274,15 @@ Not all file systems can record creation and last access times, and not all file



<a href="/windows/desktop/api/fileapi/nf-fileapi-findfirstfilea">FindFirstFile</a>
<a href="/windows/desktop/api/fileapi/nf-fileapi-findfirstfilew">FindFirstFile</a>



<a href="/windows/desktop/api/fileapi/nf-fileapi-findfirstfileexa">FindFirstFileEx</a>
<a href="/windows/desktop/api/fileapi/nf-fileapi-findfirstfileexw">FindFirstFileEx</a>



<a href="/windows/desktop/api/fileapi/nf-fileapi-findnextfilea">FindNextFile</a>
<a href="/windows/desktop/api/fileapi/nf-fileapi-findnextfilew">FindNextFile</a>



Expand Down
13 changes: 8 additions & 5 deletions sdk-api-src/content/shellapi/nf-shellapi-shellexecuteexw.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Performs an operation on a specified file.

### -param pExecInfo [in, out]

Type: <b>SHELLEXECUTEINFO*</b>
Type: <b>SHELLEXECUTEINFOW*</b>

A pointer to a <a href="/windows/desktop/api/shellapi/ns-shellapi-shellexecuteinfow">SHELLEXECUTEINFO</a> structure that contains and receives information about the application being executed.

Expand All @@ -90,11 +90,11 @@ There are instances where <b>ShellExecuteEx</b> does not use one of these types

When DLLs are loaded into your process, you acquire a lock known as a <a href="/windows/win32/win7appqual/preventing-hangs-in-windows-applications">loader lock</a>. The <a href="/windows/desktop/Dlls/dllmain">DllMain</a> function always executes under the loader lock. It is important that you do not call <b>ShellExecuteEx</b> while you hold a loader lock. Because <b>ShellExecuteEx</b> is extensible, you could load code that does not function properly in the presence of a loader lock, risking a deadlock and therefore an unresponsive thread.

With multiple monitors, if you specify an <b>HWND</b> and set the <b>lpVerb</b> member of the <a href="/windows/desktop/api/shellapi/ns-shellapi-shellexecuteinfoa">SHELLEXECUTEINFO</a> structure pointed to by <i>lpExecInfo</i> to "Properties", any windows created by <b>ShellExecuteEx</b> might not appear in the correct position.
With multiple monitors, if you specify an <b>HWND</b> and set the <b>lpVerb</b> member of the <a href="/windows/desktop/api/shellapi/ns-shellapi-shellexecuteinfow">SHELLEXECUTEINFO</a> structure pointed to by <i>lpExecInfo</i> to "Properties", any windows created by <b>ShellExecuteEx</b> might not appear in the correct position.

If the function succeeds, it sets the <b>hInstApp</b> member of the <a href="/windows/desktop/api/shellapi/ns-shellapi-shellexecuteinfoa">SHELLEXECUTEINFO</a> structure to a value greater than 32. If the function fails, <b>hInstApp</b> is set to the <a href="/windows/desktop/api/shellapi/nf-shellapi-shellexecutea">SE_ERR_XXX</a> error value that best indicates the cause of the failure. Although <b>hInstApp</b> is declared as an HINSTANCE for compatibility with 16-bit Windows applications, it is not a true HINSTANCE. It can be cast only to an <b>int</b> and can be compared only to either the value 32 or the SE_ERR_XXX error codes.
If the function succeeds, it sets the <b>hInstApp</b> member of the <a href="/windows/desktop/api/shellapi/ns-shellapi-shellexecuteinfow">SHELLEXECUTEINFO</a> structure to a value greater than 32. If the function fails, <b>hInstApp</b> is set to the <a href="/windows/desktop/api/shellapi/nf-shellapi-shellexecutew">SE_ERR_XXX</a> error value that best indicates the cause of the failure. Although <b>hInstApp</b> is declared as an HINSTANCE for compatibility with 16-bit Windows applications, it is not a true HINSTANCE. It can be cast only to an <b>int</b> and can be compared only to either the value 32 or the SE_ERR_XXX error codes.

The SE_ERR_XXX error values are provided for compatibility with <a href="/windows/desktop/api/shellapi/nf-shellapi-shellexecutea">ShellExecute</a>. To retrieve more accurate error information, use <a href="/windows/desktop/api/errhandlingapi/nf-errhandlingapi-getlasterror">GetLastError</a>. It may return one of the following values.
The SE_ERR_XXX error values are provided for compatibility with <a href="/windows/desktop/api/shellapi/nf-shellapi-shellexecutew">ShellExecute</a>. To retrieve more accurate error information, use <a href="/windows/desktop/api/errhandlingapi/nf-errhandlingapi-getlasterror">GetLastError</a>. It may return one of the following values.

<table class="clsStd">
<tr>
Expand Down Expand Up @@ -165,4 +165,7 @@ The SE_ERR_XXX error values are provided for compatibility with <a href="/window



<a href="/windows/desktop/api/shellapi/nf-shellapi-shellexecutea">ShellExecute</a>
<a href="/windows/desktop/api/shellapi/nf-shellapi-shellexecutew">ShellExecute</a>



Loading