From 24f280dc4a700f00f5fbb8f13815b941620adb8e Mon Sep 17 00:00:00 2001 From: zlockard Date: Wed, 31 Jan 2024 13:45:54 -0800 Subject: Fixes for sample build errors and updates to the execution script to use new build flags (#1078) * Fixes for sample build errors * Fix additional sample * Add additional sample * Updated comments in Build-Sample.ps1 * Adjusting exclusions.csv to be accurate for GE. Still issues for NI that we need to understand better * Merge from develop branch * Merge from develop branch * Merge from develop branch * Delete WPD samples * Separate infverif additional options for old vs new WDK * Delete WPD samples entry in our CODEOWNERS file * Fix spelling error * For 22621 WDK Remove the /samples flag --------- Co-authored-by: Zac Lockard Co-authored-by: Jakob Lichtenberg (170957) --- wpd/WpdWudfSampleDriver/WpdNetworkConfig.cpp | 122 --------------------------- 1 file changed, 122 deletions(-) delete mode 100644 wpd/WpdWudfSampleDriver/WpdNetworkConfig.cpp (limited to 'wpd/WpdWudfSampleDriver/WpdNetworkConfig.cpp') diff --git a/wpd/WpdWudfSampleDriver/WpdNetworkConfig.cpp b/wpd/WpdWudfSampleDriver/WpdNetworkConfig.cpp deleted file mode 100644 index c09f7c25..00000000 --- a/wpd/WpdWudfSampleDriver/WpdNetworkConfig.cpp +++ /dev/null @@ -1,122 +0,0 @@ -#include "stdafx.h" -#include "WpdNetworkConfig.tmh" - -WpdNetworkConfig::WpdNetworkConfig() -{ - -} - -WpdNetworkConfig::~WpdNetworkConfig() -{ - -} - -HRESULT WpdNetworkConfig::Initialize(_In_ FakeDevice *pFakeDevice) -{ - HRESULT hr = S_OK; - - if(pFakeDevice == NULL) - { - hr = E_POINTER; - CHECK_HR(hr, "Cannot have NULL parameter"); - return hr; - } - m_pFakeDevice = pFakeDevice; - return hr; -} - - -HRESULT WpdNetworkConfig::DispatchWpdMessage(_In_ REFPROPERTYKEY Command, - _In_ IPortableDeviceValues* pParams, - _In_ IPortableDeviceValues* pResults) -{ - HRESULT hr = S_OK; - - if (hr == S_OK) - { - if (Command.fmtid != WPD_CATEGORY_NETWORK_CONFIGURATION) - { - hr = E_INVALIDARG; - CHECK_HR(hr, "This object does not support this command category %ws",CComBSTR(Command.fmtid)); - } - } - - if (hr == S_OK) - { - if(IsEqualPropertyKey(Command, WPD_COMMAND_PROCESS_WIRELESS_PROFILE)) - { - hr = OnProcessWFCObject(pParams, pResults); - CHECK_HR(hr, "Failed to commit WFC file"); - } - else - { - hr = E_NOTIMPL; - CHECK_HR(hr, "This object does not support this command id %d", Command.pid); - } - } - return hr; -} - - - -/** - * This method is called when we receive a WPD_COMMAND_PROCESS_WIRELESS_PROFILE - * command. - * - * The parameters sent to us are: - * - WPD_PROPERTY_OBJECT_ID: identifies the object to process. - * - * The driver should: - * - - */ -HRESULT WpdNetworkConfig::OnProcessWFCObject( - _In_ IPortableDeviceValues* pParams, - _In_ IPortableDeviceValues* pResults) -{ - HRESULT hr = S_OK; - LPWSTR pszObjectID = NULL; - - UNREFERENCED_PARAMETER(pResults); - - // Get the Object ID - hr = pParams->GetStringValue(WPD_PROPERTY_OBJECT_PROPERTIES_OBJECT_ID, &pszObjectID); - if (hr == S_OK) - { - FakeContent* pElement = NULL; - - // Check if the object exists - if(m_pFakeDevice->GetContent(pszObjectID, &pElement)) - { - // Check if the object is of the proper content type - if (IsEqualGUID(pElement->ContentType, WPD_CONTENT_TYPE_WIRELESS_PROFILE)) - { - BYTE Buffer[16]; - DWORD dwNumBytesRead = 0; - - // Perform minimal validation on the object contents (just read some bytes for this sample) - hr = pElement->ReadData(WPD_RESOURCE_DEFAULT, 0, Buffer, sizeof(Buffer), &dwNumBytesRead); - CHECK_HR(hr, "Failed to read resource data for %ws.%d", CComBSTR(WPD_RESOURCE_DEFAULT.fmtid), WPD_RESOURCE_DEFAULT.pid); - } - else - { - hr = E_INVALIDARG; - CHECK_HR(hr, "Invalid ObjectID for OnProcessWFCObject [%ws]", pszObjectID); - } - } - else - { - hr = E_INVALIDARG; - CHECK_HR(hr, "Invalid ObjectID [%ws]", pszObjectID); - } - - CoTaskMemFree(pszObjectID); - } - else - { - CHECK_HR(hr, "Missing or invalid value for WPD_PROPERTY_OBJECT_PROPERTIES_OBJECT_ID"); - } - - return hr; -} - - -- cgit v1.3.1