diff --git a/PInvoke/CldApi/cfapi.Funcs.cs b/PInvoke/CldApi/cfapi.Funcs.cs index 1656da0f..57cedb4e 100644 --- a/PInvoke/CldApi/cfapi.Funcs.cs +++ b/PInvoke/CldApi/cfapi.Funcs.cs @@ -176,6 +176,78 @@ namespace Vanara.PInvoke public static unsafe extern HRESULT CfConvertToPlaceholder(HFILE FileHandle, [In, Optional] IntPtr FileIdentity, uint FileIdentityLength, CF_CONVERT_FLAGS ConvertFlags, [Out, Optional] int* ConvertUsn, [In, Out, Optional] NativeOverlapped* Overlapped); + /// + /// Dehydrates a placeholder file by ensuring that the specified byte range is not present on-disk in the placeholder. This is valid + /// for files only. + /// + /// [in] A handle to the placeholder file. + /// [in] The starting point offset of the placeholder file data. + /// + /// [in] The length, in bytes, of the placeholder file whose data must be invalidated locally on the disk after the API completes + /// successfully. A length of -1 signifies end of file. + /// + /// [in] Placeholder dehydration flags. + /// + /// + /// [in, out, optional] When specified and combined with an asynchronous FileHandle, Overlapped allows the platform to perform the + /// CfDehydratePlaceholder call asynchronously. See the Remarks for more details. + /// + /// If not specified, the platform will perform the API call synchronously, regardless of how the handle was created. + /// + /// This function does not return a value. + /// + /// + /// The caller must acquire an exclusive handle to the file or data corruption can occur. To minimize the impact on user + /// applications it is highly recommended that the caller obtain the exclusiveness using proper oplocks (via + /// CfOpenFileWithOplock) as opposed to using a share-nothing handle. + /// + /// + /// If the API returns HRESULT_FROM_WIN32(ERROR_IO_PENDING) when using Overlapped asynchronously, the caller can then wait using GetOverlappedResult. + /// + /// + // https://docs.microsoft.com/en-us/previous-versions/mt827480(v=vs.85) void STDAPI CfDehydratePlaceholder( _In_ HANDLE FileHandle, + // _In_ LARGE_INTEGER StartingOffset, _In_ LARGE_INTEGER Length, _In_ CF_HYDRATE_FLAGS DehydrateFlags, _Inout_opt_ LPOVERLAPPED + // Overlapped ); + [DllImport(Lib.CldApi, SetLastError = false, ExactSpelling = true)] + [PInvokeData("CfApi.h")] + public static extern HRESULT CfDehydratePlaceholder(HFILE FileHandle, long StartingOffset, long Length, CF_DEHYDRATE_FLAGS DehydrateFlags, [In, Out, Optional] IntPtr Overlapped); + + /// + /// Dehydrates a placeholder file by ensuring that the specified byte range is not present on-disk in the placeholder. This is valid + /// for files only. + /// + /// [in] A handle to the placeholder file. + /// [in] The starting point offset of the placeholder file data. + /// + /// [in] The length, in bytes, of the placeholder file whose data must be invalidated locally on the disk after the API completes + /// successfully. A length of -1 signifies end of file. + /// + /// [in] Placeholder dehydration flags. + /// + /// + /// [in, out, optional] When specified and combined with an asynchronous FileHandle, Overlapped allows the platform to perform the + /// CfDehydratePlaceholder call asynchronously. See the Remarks for more details. + /// + /// If not specified, the platform will perform the API call synchronously, regardless of how the handle was created. + /// + /// This function does not return a value. + /// + /// + /// The caller must acquire an exclusive handle to the file or data corruption can occur. To minimize the impact on user + /// applications it is highly recommended that the caller obtain the exclusiveness using proper oplocks (via + /// CfOpenFileWithOplock) as opposed to using a share-nothing handle. + /// + /// + /// If the API returns HRESULT_FROM_WIN32(ERROR_IO_PENDING) when using Overlapped asynchronously, the caller can then wait using GetOverlappedResult. + /// + /// + // https://docs.microsoft.com/en-us/previous-versions/mt827480(v=vs.85) void STDAPI CfDehydratePlaceholder( _In_ HANDLE FileHandle, + // _In_ LARGE_INTEGER StartingOffset, _In_ LARGE_INTEGER Length, _In_ CF_HYDRATE_FLAGS DehydrateFlags, _Inout_opt_ LPOVERLAPPED + // Overlapped ); + [DllImport(Lib.CldApi, SetLastError = false, ExactSpelling = true)] + [PInvokeData("CfApi.h")] + public static unsafe extern HRESULT CfDehydratePlaceholder(HFILE FileHandle, long StartingOffset, long Length, CF_DEHYDRATE_FLAGS DehydrateFlags, [In, Out] NativeOverlapped* Overlapped); + /// Creates one or more new placeholder files or directories under a sync root tree. /// Local directory path under which placeholders are created. /// diff --git a/PInvoke/CldApi/cfapi.cs b/PInvoke/CldApi/cfapi.cs index aabb4a69..c129f741 100644 --- a/PInvoke/CldApi/cfapi.cs +++ b/PInvoke/CldApi/cfapi.cs @@ -1577,6 +1577,9 @@ namespace Vanara.PInvoke /// A pointer to the callback function. [MarshalAs(UnmanagedType.FunctionPtr)] public CF_CALLBACK Callback; + + /// An instance of CF_CALLBACK_REGISTRATION that indicates the end of the registration list. + public static readonly CF_CALLBACK_REGISTRATION CF_CALLBACK_REGISTRATION_END = new CF_CALLBACK_REGISTRATION { Type = CF_CALLBACK_TYPE.CF_CALLBACK_TYPE_NONE }; } /// Opaque handle to a connection key.