diff --git a/sdk-api-src/content/fileapi/nf-fileapi-createfilew.md b/sdk-api-src/content/fileapi/nf-fileapi-createfilew.md index 87882064feb..7bc943d438e 100644 --- a/sdk-api-src/content/fileapi/nf-fileapi-createfilew.md +++ b/sdk-api-src/content/fileapi/nf-fileapi-createfilew.md @@ -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 - Defining an MS-DOS Device Name. + Defining an MS-DOS Device Name. To create a file stream, specify the name of the file, a colon, and then the name of the stream. For more - information, see File Streams. + information, see File Streams. 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). @@ -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 GENERIC_READ, GENERIC_WRITE, or both @@ -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 CreateFile on a file that is pending deletion - as a result of a previous call to DeleteFile, the function + as a result of a previous call to DeleteFile, the function fails. The operating system delays file deletion until all handles to the file are closed. GetLastError returns ERROR_ACCESS_DENIED. @@ -1032,8 +1032,8 @@ An application cannot create a directory by using CreateFile, therefore only the OPEN_EXISTING value is valid for dwCreationDisposition for this use case. To create a directory, the application must - call CreateDirectory or - CreateDirectoryEx. + call CreateDirectory or + CreateDirectoryEx. To open a directory using CreateFile, specify the FILE_FLAG_BACKUP_SEMANTICS flag as part of @@ -1334,9 +1334,9 @@ If CreateFile 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 dwOpenMode parameter of the - CreateNamedPipe function. + CreateNamedPipe function. -If the CreateNamedPipe function was not +If the CreateNamedPipe function was not successfully called on the server prior to this operation, a pipe will not exist and CreateFile will fail with ERROR_FILE_NOT_FOUND. @@ -1464,23 +1464,23 @@ A tape backup code snippet can found at -CreateDirectory +CreateDirectory -CreateDirectoryEx +CreateDirectoryEx -CreateFileTransacted +CreateFileTransacted -CreateMailSlot +CreateMailSlot -CreateNamedPipe +CreateNamedPipe @@ -1488,7 +1488,7 @@ A tape backup code snippet can found at -DeleteFile +DeleteFile @@ -1564,7 +1564,7 @@ A tape backup code snippet can found at -SetFileAttributes +SetFileAttributes @@ -1573,3 +1573,4 @@ A tape backup code snippet can found at WriteFileEx + diff --git a/sdk-api-src/content/fileapi/nf-fileapi-deletefilew.md b/sdk-api-src/content/fileapi/nf-fileapi-deletefilew.md index 596522d3e4e..6afe45afa81 100644 --- a/sdk-api-src/content/fileapi/nf-fileapi-deletefilew.md +++ b/sdk-api-src/content/fileapi/nf-fileapi-deletefilew.md @@ -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. @@ -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: @@ -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) + diff --git a/sdk-api-src/content/fileapi/nf-fileapi-findfirstfilew.md b/sdk-api-src/content/fileapi/nf-fileapi-findfirstfilew.md index 603aab599f1..c2a29d7d47a 100644 --- a/sdk-api-src/content/fileapi/nf-fileapi-findfirstfilew.md +++ b/sdk-api-src/content/fileapi/nf-fileapi-findfirstfilew.md @@ -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 WIN32_FIND_DATA structure that +A pointer to the WIN32_FIND_DATA structure that receives information about a found file or directory. ## -returns @@ -338,3 +338,4 @@ For another example, see WIN32_FIND_DATA + diff --git a/sdk-api-src/content/fileapi/nf-fileapi-writefile.md b/sdk-api-src/content/fileapi/nf-fileapi-writefile.md index 6c1e3b8fd6e..c3acb5ec29f 100644 --- a/sdk-api-src/content/fileapi/nf-fileapi-writefile.md +++ b/sdk-api-src/content/fileapi/nf-fileapi-writefile.md @@ -250,7 +250,7 @@ int main() // ... Add code using bufferAligned here. // Replace with corresponding free routine. - delete buffer; + delete[] buffer; } ``` @@ -280,3 +280,4 @@ int main() [SetEndOfFile](nf-fileapi-setendoffile.md) [WriteFileEx](nf-fileapi-writefileex.md) + diff --git a/sdk-api-src/content/minwinbase/ns-minwinbase-win32_find_dataw.md b/sdk-api-src/content/minwinbase/ns-minwinbase-win32_find_dataw.md index 88c2c685497..a4cf42a9544 100644 --- a/sdk-api-src/content/minwinbase/ns-minwinbase-win32_find_dataw.md +++ b/sdk-api-src/content/minwinbase/ns-minwinbase-win32_find_dataw.md @@ -60,9 +60,9 @@ api_name: ## -description Contains information about the file that is found by the - FindFirstFile, - FindFirstFileEx, or - FindNextFile function. + FindFirstFile, + FindFirstFileEx, or + FindNextFile function. ## -struct-fields @@ -226,11 +226,11 @@ typedef struct _WIN32_FIND_DATAW { If a file has a long file name, the complete name appears in the cFileName member, and the 8.3 format truncated version of the name appears in the cAlternateFileName member. Otherwise, cAlternateFileName is empty. If the - FindFirstFileEx function was called with a value of + FindFirstFileEx function was called with a value of FindExInfoBasic in the fInfoLevelId parameter, the cAlternateFileName member will always contain a NULL string value. This remains true for all subsequent calls to the - FindNextFile function. As an alternative method of + FindNextFile function. As an alternative method of retrieving the 8.3 format version of a file name, you can use the GetShortPathName function. For more information about file names, see File Names, Paths, and Namespaces. @@ -274,15 +274,15 @@ Not all file systems can record creation and last access times, and not all file -FindFirstFile +FindFirstFile -FindFirstFileEx +FindFirstFileEx -FindNextFile +FindNextFile diff --git a/sdk-api-src/content/shellapi/nf-shellapi-shellexecuteexw.md b/sdk-api-src/content/shellapi/nf-shellapi-shellexecuteexw.md index 69a52645319..4f48c6c67ac 100644 --- a/sdk-api-src/content/shellapi/nf-shellapi-shellexecuteexw.md +++ b/sdk-api-src/content/shellapi/nf-shellapi-shellexecuteexw.md @@ -65,7 +65,7 @@ Performs an operation on a specified file. ### -param pExecInfo [in, out] -Type: SHELLEXECUTEINFO* +Type: SHELLEXECUTEINFOW* A pointer to a SHELLEXECUTEINFO structure that contains and receives information about the application being executed. @@ -90,11 +90,11 @@ There are instances where ShellExecuteEx does not use one of these types When DLLs are loaded into your process, you acquire a lock known as a loader lock. The DllMain function always executes under the loader lock. It is important that you do not call ShellExecuteEx while you hold a loader lock. Because ShellExecuteEx 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 HWND and set the lpVerb member of the SHELLEXECUTEINFO structure pointed to by lpExecInfo to "Properties", any windows created by ShellExecuteEx might not appear in the correct position. +With multiple monitors, if you specify an HWND and set the lpVerb member of the SHELLEXECUTEINFO structure pointed to by lpExecInfo to "Properties", any windows created by ShellExecuteEx might not appear in the correct position. -If the function succeeds, it sets the hInstApp member of the SHELLEXECUTEINFO structure to a value greater than 32. If the function fails, hInstApp is set to the SE_ERR_XXX error value that best indicates the cause of the failure. Although hInstApp 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 int and can be compared only to either the value 32 or the SE_ERR_XXX error codes. +If the function succeeds, it sets the hInstApp member of the SHELLEXECUTEINFO structure to a value greater than 32. If the function fails, hInstApp is set to the SE_ERR_XXX error value that best indicates the cause of the failure. Although hInstApp 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 int 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 ShellExecute. To retrieve more accurate error information, use GetLastError. It may return one of the following values. +The SE_ERR_XXX error values are provided for compatibility with ShellExecute. To retrieve more accurate error information, use GetLastError. It may return one of the following values. @@ -165,4 +165,7 @@ The SE_ERR_XXX error values are provided for compatibility with ShellExecute +ShellExecute + + + diff --git a/sdk-api-src/content/shellapi/ns-shellapi-shellexecuteinfow.md b/sdk-api-src/content/shellapi/ns-shellapi-shellexecuteinfow.md index e20959f6796..b1fe3bac50d 100644 --- a/sdk-api-src/content/shellapi/ns-shellapi-shellexecuteinfow.md +++ b/sdk-api-src/content/shellapi/ns-shellapi-shellexecuteinfow.md @@ -54,7 +54,7 @@ no-loc: [verb, verbs, NULL, null, runas] ## -description -Contains information used by ShellExecuteEx. +Contains information used by ShellExecuteEx. ## -struct-fields @@ -94,7 +94,7 @@ A combination of one or more of the following values that indicate the content a - @@ -111,7 +111,7 @@ A combination of one or more of the following values that indicate the content a - + @@ -121,7 +121,7 @@ A combination of one or more of the following values that indicate the content a @@ -149,7 +149,7 @@ For further discussion on when this flag is necessary, see the Remarks section.< - + @@ -161,7 +161,7 @@ For further discussion on when this flag is necessary, see the Remarks section.< - + @@ -173,7 +173,7 @@ For further discussion on when this flag is necessary, see the Remarks section.< -
SEE_MASK_INVOKEIDLIST (0x0000000C)Use the IContextMenu interface of the selected item's shortcut menu handler. Use either lpFile to identify the item by its file system path or lpIDList to identify the item by its PIDL. This flag allows applications to use ShellExecuteEx to invoke verbs from shortcut menu extensions instead of the static verbs listed in the registry. +Use the IContextMenu interface of the selected item's shortcut menu handler. Use either lpFile to identify the item by its file system path or lpIDList to identify the item by its PIDL. This flag allows applications to use ShellExecuteEx to invoke verbs from shortcut menu extensions instead of the static verbs listed in the registry.
Note: SEE_MASK_INVOKEIDLIST overrides and implies SEE_MASK_IDLIST.
SEE_MASK_NOCLOSEPROCESS (0x00000040)Use to indicate that the hProcess member receives the process handle. This handle is typically used to allow an application to find out when a process created with ShellExecuteEx terminates. In some cases, such as when execution is satisfied through a DDE conversation, no handle will be returned. The calling application is responsible for closing the handle when it is no longer needed.Use to indicate that the hProcess member receives the process handle. This handle is typically used to allow an application to find out when a process created with ShellExecuteEx terminates. In some cases, such as when execution is satisfied through a DDE conversation, no handle will be returned. The calling application is responsible for closing the handle when it is no longer needed.
SEE_MASK_CONNECTNETDRV (0x00000080)SEE_MASK_NOASYNC (0x00000100) Only respected when launching files, does not apply to uris or shell namespace items (e.g. "This PC"). Wait for the async part of the execute operation, (e.g. DDE) to complete before returning. When this applies it ensures the launching operation finishes before returning. Applications that exit immediately after calling ShellExecuteEx should specify this flag. Note, ShellExecuteEx moves its work to a background thread if the caller's threading model is not Apartment. Forcing the call to be synchronous disables that behavior and uses the callers COM apartment. Specifing SEE_MASK_FLAG_HINST_IS_SITE forces synchronous behavior always. -If the execute operation is performed on a background thread and the caller did not specify the SEE_MASK_ASYNCOK flag, then the calling thread waits until the new process has started before returning. This typically means that either CreateProcess has been called, the DDE communication has completed, or that the custom execution delegate has notified ShellExecuteEx that it is done. If the SEE_MASK_WAITFORINPUTIDLE flag is specified, then ShellExecuteEx calls WaitForInputIdle and waits for the new process to idle before returning, with a maximum timeout of 1 minute. +If the execute operation is performed on a background thread and the caller did not specify the SEE_MASK_ASYNCOK flag, then the calling thread waits until the new process has started before returning. This typically means that either CreateProcess has been called, the DDE communication has completed, or that the custom execution delegate has notified ShellExecuteEx that it is done. If the SEE_MASK_WAITFORINPUTIDLE flag is specified, then ShellExecuteEx calls WaitForInputIdle and waits for the new process to idle before returning, with a maximum timeout of 1 minute. For further discussion on when this flag is necessary, see the Remarks section.
SEE_MASK_ASYNCOK (0x00100000) The execution can be performed on a background thread and the call should return immediately without waiting for the background thread to finish. Note that in certain cases ShellExecuteEx ignores this flag and waits for the process to finish before returning.The execution can be performed on a background thread and the call should return immediately without waiting for the background thread to finish. Note that in certain cases ShellExecuteEx ignores this flag and waits for the process to finish before returning.
SEE_MASK_NOQUERYCLASSSTORE (0x01000000)
SEE_MASK_NOZONECHECKS (0x00800000)Do not perform a zone check. This flag allows ShellExecuteEx to bypass zone checking put into place by IAttachmentExecute.Do not perform a zone check. This flag allows ShellExecuteEx to bypass zone checking put into place by IAttachmentExecute.
SEE_MASK_WAITFORINPUTIDLE (0x02000000)
SEE_MASK_FLAG_HINST_IS_SITE` (0x08000000)The hInstApp member is used to specify the IUnknown of an object that implements IServiceProvider. This object will be used as a site pointer. The site pointer is used to provide services to the ShellExecuteEx function, the handler binding process, and invoked verb handlers. +The hInstApp member is used to specify the IUnknown of an object that implements IServiceProvider. This object will be used as a site pointer. The site pointer is used to provide services to the ShellExecuteEx function, the handler binding process, and invoked verb handlers. ICreatingProcess can be provided to allow the caller to alter some parameters of the process being created. @@ -209,7 +209,7 @@ A string, referred to as a verb, that specifies the action to be performe Type: LPCTSTR -The address of a null-terminated string that specifies the name of the file or object on which ShellExecuteEx will perform the action specified by the lpVerb parameter. The system registry verbs that are supported by the ShellExecuteEx function include ":::no-loc text="open"::" for executable files and document files and ":::no-loc text="print"::" for document files for which a print handler has been registered. Other applications might have added Shell verbs through the system registry, such as ":::no-loc text="play"::" for .avi and .wav files. To specify a Shell namespace object, pass the fully qualified parse name and set the SEE_MASK_INVOKEIDLIST flag in the fMask parameter. +The address of a null-terminated string that specifies the name of the file or object on which ShellExecuteEx will perform the action specified by the lpVerb parameter. The system registry verbs that are supported by the ShellExecuteEx function include ":::no-loc text="open"::" for executable files and document files and ":::no-loc text="print"::" for document files for which a print handler has been registered. Other applications might have added Shell verbs through the system registry, such as ":::no-loc text="play"::" for .avi and .wav files. To specify a Shell namespace object, pass the fully qualified parse name and set the SEE_MASK_INVOKEIDLIST flag in the fMask parameter.
Note: If the SEE_MASK_INVOKEIDLIST flag is set, you can use either lpFile or lpIDList to identify the item by its file system path or its PIDL respectively. One of the two values—lpFile or lpIDList—must be set.
@@ -231,13 +231,13 @@ Optional. The address of a null-terminated string that specifies the name of the Type: int -Required. Flags that specify how an application is to be shown when it is opened; one of the SW_ values listed for the ShellExecute function. If lpFile specifies a document file, the flag is simply passed to the associated application. It is up to the application to decide how to handle it. +Required. Flags that specify how an application is to be shown when it is opened; one of the SW_ values listed for the ShellExecute function. If lpFile specifies a document file, the flag is simply passed to the associated application. It is up to the application to decide how to handle it. ### -field hInstApp Type: HINSTANCE -[out] If SEE_MASK_NOCLOSEPROCESS is set and the ShellExecuteEx call succeeds, it sets this member to a value greater than 32. If the function fails, it is set to an SE_ERR_XXX error value that indicates the cause of the failure. Although hInstApp 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 int and compared to either 32 or the following SE_ERR_XXX error codes. +[out] If SEE_MASK_NOCLOSEPROCESS is set and the ShellExecuteEx call succeeds, it sets this member to a value greater than 32. If the function fails, it is set to an SE_ERR_XXX error value that indicates the cause of the failure. Although hInstApp 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 int and compared to either 32 or the following SE_ERR_XXX error codes.
@@ -306,13 +306,13 @@ Type: HANDLE A handle to the newly started application. This member is set on return and is always NULL unless fMask is set to SEE_MASK_NOCLOSEPROCESS. Even if fMask is set to SEE_MASK_NOCLOSEPROCESS, hProcess will be NULL if no process was launched. For example, if a document to be launched is a URL and an instance of Internet Explorer is already running, it will display the document. No new process is launched, and hProcess will be NULL. -
Note: ShellExecuteEx does not always return an hProcess, even if a process is launched as the result of the call. For example, an hProcess does not return when you use SEE_MASK_INVOKEIDLIST to invoke IContextMenu.
+
Note: ShellExecuteEx does not always return an hProcess, even if a process is launched as the result of the call. For example, an hProcess does not return when you use SEE_MASK_INVOKEIDLIST to invoke IContextMenu.
## -remarks -The SEE_MASK_NOASYNC flag must be specified if the thread calling ShellExecuteEx does not have a message loop or if the thread or process will terminate soon after ShellExecuteEx returns. Under such conditions, the calling thread will not be available to complete the DDE conversation, so it is important that ShellExecuteEx complete the conversation before returning control to the calling application. Failure to complete the conversation can result in an unsuccessful launch of the document. +The SEE_MASK_NOASYNC flag must be specified if the thread calling ShellExecuteEx does not have a message loop or if the thread or process will terminate soon after ShellExecuteEx returns. Under such conditions, the calling thread will not be available to complete the DDE conversation, so it is important that ShellExecuteEx complete the conversation before returning control to the calling application. Failure to complete the conversation can result in an unsuccessful launch of the document. -If the calling thread has a message loop and will exist for some time after the call to ShellExecuteEx returns, the SEE_MASK_NOASYNC flag is optional. If the flag is omitted, the calling thread's message pump will be used to complete the DDE conversation. The calling application regains control sooner, since the DDE conversation can be completed in the background. +If the calling thread has a message loop and will exist for some time after the call to ShellExecuteEx returns, the SEE_MASK_NOASYNC flag is optional. If the flag is omitted, the calling thread's message pump will be used to complete the DDE conversation. The calling application regains control sooner, since the DDE conversation can be completed in the background. For calls to this API that result from user interaction specify SEE_MASK_FLAG_LOG_USAGE. diff --git a/sdk-api-src/content/winbase/nf-winbase-movefilew.md b/sdk-api-src/content/winbase/nf-winbase-movefilew.md index 2703b6df801..e45a655acfa 100644 --- a/sdk-api-src/content/winbase/nf-winbase-movefilew.md +++ b/sdk-api-src/content/winbase/nf-winbase-movefilew.md @@ -64,11 +64,11 @@ api_name: Moves an existing file or a directory, including its children. To specify how to move the file, use the - MoveFileEx or - MoveFileWithProgress function. + MoveFileEx or + MoveFileWithProgress function. To perform this operation as a transacted operation, use the - MoveFileTransacted function. + MoveFileTransacted function. ## -parameters @@ -191,12 +191,13 @@ SMB 3.0 does not support rename of alternate data streams on file shares with co -MoveFileEx +MoveFileEx -MoveFileTransacted +MoveFileTransacted -MoveFileWithProgress +MoveFileWithProgress +