From d4c76dd11f5a096b4fd3ee9c5efc1f44559ac3da Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sat, 17 Apr 2021 20:58:32 -0500 Subject: Send more progress during cache verification. Add verifyStep to OnCacheVerifyProgress. Send OnContainerOrPayloadVerify events only if file existed in cache. --- src/test/BurnUnitTest/CacheTest.cpp | 46 ++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) (limited to 'src/test/BurnUnitTest/CacheTest.cpp') diff --git a/src/test/BurnUnitTest/CacheTest.cpp b/src/test/BurnUnitTest/CacheTest.cpp index fc0b4531..d0cc237f 100644 --- a/src/test/BurnUnitTest/CacheTest.cpp +++ b/src/test/BurnUnitTest/CacheTest.cpp @@ -2,6 +2,26 @@ #include "precomp.h" +static HRESULT CALLBACK CacheTestEventRoutine( + __in BURN_CACHE_MESSAGE* pMessage, + __in LPVOID pvContext + ); + +static DWORD CALLBACK CacheTestProgressRoutine( + __in LARGE_INTEGER TotalFileSize, + __in LARGE_INTEGER TotalBytesTransferred, + __in LARGE_INTEGER StreamSize, + __in LARGE_INTEGER StreamBytesTransferred, + __in DWORD dwStreamNumber, + __in DWORD dwCallbackReason, + __in HANDLE hSourceFile, + __in HANDLE hDestinationFile, + __in_opt LPVOID lpData + ); + +typedef struct _CACHE_TEST_CONTEXT +{ +} CACHE_TEST_CONTEXT; namespace Microsoft { @@ -33,6 +53,7 @@ namespace Bootstrapper LPWSTR sczPayloadPath = NULL; BYTE* pb = NULL; DWORD cb = NULL; + CACHE_TEST_CONTEXT context = { }; try { @@ -51,7 +72,7 @@ namespace Bootstrapper payload.pbHash = pb; payload.cbHash = cb; - hr = CacheCompletePayload(package.fPerMachine, &payload, package.sczCacheId, sczPayloadPath, FALSE); + hr = CacheCompletePayload(package.fPerMachine, &payload, package.sczCacheId, sczPayloadPath, FALSE, CacheTestEventRoutine, CacheTestProgressRoutine, &context); Assert::Equal(S_OK, hr); } finally @@ -73,3 +94,26 @@ namespace Bootstrapper } } } + +static HRESULT CALLBACK CacheTestEventRoutine( + __in BURN_CACHE_MESSAGE* /*pMessage*/, + __in LPVOID /*pvContext*/ + ) +{ + return S_OK; +} + +static DWORD CALLBACK CacheTestProgressRoutine( + __in LARGE_INTEGER /*TotalFileSize*/, + __in LARGE_INTEGER /*TotalBytesTransferred*/, + __in LARGE_INTEGER /*StreamSize*/, + __in LARGE_INTEGER /*StreamBytesTransferred*/, + __in DWORD /*dwStreamNumber*/, + __in DWORD /*dwCallbackReason*/, + __in HANDLE /*hSourceFile*/, + __in HANDLE /*hDestinationFile*/, + __in_opt LPVOID /*lpData*/ + ) +{ + return PROGRESS_QUIET; +} -- cgit v1.2.3-55-g6feb