Based on a patch by Michael Müller.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=42577 Signed-off-by: Gijs Vermeulen gijsvrm@gmail.com --- dlls/virtdisk/virtdisk.spec | 2 +- dlls/virtdisk/virtdisk_main.c | 37 +++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-)
diff --git a/dlls/virtdisk/virtdisk.spec b/dlls/virtdisk/virtdisk.spec index 2946b66d50..6bd5f146db 100644 --- a/dlls/virtdisk/virtdisk.spec +++ b/dlls/virtdisk/virtdisk.spec @@ -8,7 +8,7 @@ @ stub EnumerateVirtualDiskMetadata @ stub ExpandVirtualDisk @ stub GetAllAttachedVirtualDiskPhysicalPaths -@ stub GetStorageDependencyInformation +@ stdcall GetStorageDependencyInformation(long long long ptr ptr) @ stub GetVirtualDiskInformation @ stub GetVirtualDiskMetadata @ stub GetVirtualDiskOperationProgress diff --git a/dlls/virtdisk/virtdisk_main.c b/dlls/virtdisk/virtdisk_main.c index 0da0dca461..ff17df7fd4 100644 --- a/dlls/virtdisk/virtdisk_main.c +++ b/dlls/virtdisk/virtdisk_main.c @@ -22,10 +22,23 @@
#include "windef.h" #include "winbase.h" +#include "virtdisk.h" + #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(virtdisk);
+typedef struct _STORAGE_DEPENDENCY_INFO_LOCAL +{ + STORAGE_DEPENDENCY_INFO_VERSION Version; + ULONG NumberEntries; + __C89_NAMELESS union + { + STORAGE_DEPENDENCY_INFO_TYPE_1 Version1Entries[1]; + STORAGE_DEPENDENCY_INFO_TYPE_2 Version2Entries[1]; + } __C89_NAMELESSUNIONNAME; +} STORAGE_DEPENDENCY_INFO_LOCAL; + /***************************************************** * DllMain (VIRTDISK.@) */ @@ -44,3 +57,27 @@ BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, void *reserved)
return TRUE; } + +DWORD WINAPI GetStorageDependencyInformation(HANDLE obj, GET_STORAGE_DEPENDENCY_FLAG flags, ULONG size, STORAGE_DEPENDENCY_INFO *info, ULONG *used) +{ + ULONG temp_size = size; + + FIXME("(%p, 0x%x, %u, %p, %p): stub\n", obj, flags, size, info, used); + + if (!info || !size) + return ERROR_INVALID_PARAMETER; + + if (info->Version == 1) + temp_size = offsetof(STORAGE_DEPENDENCY_INFO_LOCAL, Version1Entries[0]); + else if (info->Version == 2) + temp_size = offsetof(STORAGE_DEPENDENCY_INFO_LOCAL, Version2Entries[0]); + + if (used) *used = temp_size; + + if (size < temp_size) + return ERROR_INSUFFICIENT_BUFFER; + + info->NumberEntries = 0; + + return ERROR_SUCCESS; +}