Пример #1
0
    if (!ppRefList) {
        hr = E_INVALIDARG;
        goto Exit;
    }
    
    hr = CAssemblyReferenceList::Create(ppwzAssemblyReferences, dwNumOfReferences, ppRefList);
    
Exit:
    return hr;
}

HRESULT CAssemblyIdentityManager::GetBindingIdentityFromFile(
        LPCWSTR pwzFilePath,
        DWORD   dwFlags,
        __out_ecount_opt(*pcchBufferSize) LPWSTR  pwzBuffer,
        __inout DWORD   *pcchBufferSize)
{
    HRESULT hr = S_OK;
    IAssemblyName *pName = NULL;
    IMetaDataAssemblyImport *pImport = NULL;
    DWORD dwImportFlags = ASM_IMPORT_NAME_ARCHITECTURE|ASM_IMPORT_NAME_PE_RUNTIME;
    DWORD dwDispFlags =  ASM_DISPLAYF_FULL;
    WORD  wVer = 0;

    if (!pwzFilePath || !pcchBufferSize) {
        hr = E_INVALIDARG;
        goto Exit;
    }

    if (dwFlags != CLR_ASSEMBLY_IDENTITY_FLAGS_DEFAULT) {
Пример #2
0
            if(result == HRESULTS::HR_S_FALSE)
            {
                hr = S_FALSE;
            }
            else
            {
                hr = E_FAIL;
            }
        }

        return hr; 
    }

    STDMETHODIMP CFrostCore::FormatString(
        __in_z LPCWSTR wzIn,
            __out_ecount_opt(*pcchOut) LPWSTR pwzOut,
            __inout DWORD* pcchOut
        )
    {
        HRESULT hr = S_OK;

        String^ InputString = gcnew String(wzIn);
        String^ OutputString = gcnew String(pwzOut);
        UInt64 StringSize = *pcchOut;

        HRESULTS result = CFrostEngine::FormatPropertyString(InputString,OutputString,StringSize);

        if(result == HRESULTS::HR_S_OK)
        {
            IntPtr p = Marshal::StringToHGlobalUni(OutputString);
            pwzOut = new WCHAR[(int)StringSize+1];
Пример #3
0
    }

    PhFree(displayToText);
    PhFree(displayToId);

    lines = PhaFormatTextTable(table, rows, columns, Mode);

    PhDeleteAutoPool(&autoPool);

    return lines;
}

VOID PhaMapDisplayIndexListView(
    __in HWND ListViewHandle,
    __out_ecount(Count) PULONG DisplayToId,
    __out_ecount_opt(Count) PPH_STRING *DisplayToText,
    __in ULONG Count,
    __out PULONG NumberOfColumns
    )
{
    LVCOLUMN lvColumn;
    ULONG i;
    ULONG count;
    WCHAR buffer[128];

    count = 0;
    lvColumn.mask = LVCF_ORDER | LVCF_TEXT;
    lvColumn.pszText = buffer;
    lvColumn.cchTextMax = sizeof(buffer) / sizeof(WCHAR);

    for (i = 0; i < Count; i++)
Пример #4
0
#include "memoryreport.h"
#include "eventtrace.h"
#include "timeline.h"
#include "asmidmgr.h"
#include "hostpcymgr.h"

extern DWORD    g_dwConfigForceUnification;

HRESULT PrepQueryMatchData(IAssemblyName *pName, 
                           __out_ecount(*pdwSizeName) LPWSTR pwzAsmName,
                           __inout LPDWORD pdwSizeName,
                           __out_ecount(*pdwSizeVer) LPWSTR pwzAsmVersion, 
                           __inout LPDWORD pdwSizeVer,
                           __out_ecount(*pdwSizePKT) LPWSTR pwzPublicKeyToken, 
                           __inout LPDWORD pdwSizePKT,
                           __out_ecount_opt(pdwSizeCulture) LPWSTR pwzCulture,
                           __inout_opt LPDWORD pdwSizeCulture,
                           __out_opt PEKIND   *pe
                           )
{
    HRESULT                                     hr = S_OK;
    DWORD                                       dwSize;
    DWORD                                       dwVerHigh;
    DWORD                                       dwVerLow;
    CAssemblyName                              *pCName = NULL;

    _ASSERTE(pName);

    // Assembly Name
    if (pwzAsmName && pdwSizeName) { 
        hr = pName->GetName(pdwSizeName, pwzAsmName);
Пример #5
0
                                        szName, 
                                        tkEnclosingClass, 
                                        ptd);
ErrExit:
    
    STOP_MD_PERF(FindTypeDefByName);
    END_ENTRYPOINT_NOTHROW;
    
    return hr;
} // STDMETHODIMP RegMeta::FindTypeDefByName()

//*****************************************************************************
// Get values from Sym.Module
//*****************************************************************************
STDMETHODIMP RegMeta::GetScopeProps(
    __out_ecount_opt (cchName) LPWSTR szName, // Put name here
    ULONG       cchName,                // Size in chars of name buffer
    ULONG       *pchName,               // Put actual length of name here
    GUID        *pmvid)                 // Put MVID here
{
    HRESULT     hr = S_OK;

    BEGIN_ENTRYPOINT_NOTHROW;

    CMiniMdRW   *pMiniMd = &(m_pStgdb->m_MiniMd);
    ModuleRec   *pModuleRec;
 

    LOG((LOGMD, "RegMeta::GetScopeProps(%S, 0x%08x, 0x%08x, 0x%08x)\n", 
            MDSTR(szName), cchName, pchName, pmvid));
    START_MD_PERF();
Пример #6
0
		NULL,
		reinterpret_cast<PBYTE>(UINumber),
		sizeof(DWORD),
		NULL);

	return success ? S_OK : HRESULT_FROM_WIN32(GetLastError());
}

HRESULT 
pRequestDeviceEjectW(
	__in LPWSTR pszEnumeratorName,
	__in BOOL UseUINumber,
	__in NDAS_LOCATION NdasLocation,
	__out_opt CONFIGRET* pConfigRet, 
	__out_opt PPNP_VETO_TYPE pVetoType, 
	__out_ecount_opt(nNameLength) LPWSTR pszVetoName, 
	__in_opt DWORD nNameLength)
{
	HRESULT hr;

	CONFIGRET cret = CR_DEFAULT;
	if (pConfigRet)
	{
		*pConfigRet = CR_DEFAULT;
	}

	// Get devices under Enum\NDAS
	XTL::AutoDeviceInfoSet deviceInfoSet = ::SetupDiGetClassDevs(
		NULL,  
		pszEnumeratorName,
		NULL, 
Пример #7
0
	EFX_MON_STAT_2_5V,		/* MC_CMD_SENSOR_IN_2V5 */
	EFX_MON_STAT_3_3V,		/* MC_CMD_SENSOR_IN_3V3 */
	EFX_MON_STAT_12V,		/* MC_CMD_SENSOR_IN_12V0 */
};

#define	SIENA_STATIC_SENSOR_ASSERT(_field)				\
	EFX_STATIC_ASSERT(MC_CMD_SENSOR_STATE_ ## _field		\
			    == EFX_MON_STAT_STATE_ ## _field)

					void
siena_mon_decode_stats(
	__in				efx_nic_t *enp,
	__in				uint32_t dmask,
	__in_opt			efsys_mem_t *esmp,
	__out_opt			uint32_t *vmaskp,
	__out_ecount_opt(EFX_MON_NSTATS)	efx_mon_stat_value_t *value)
{
	efx_mcdi_iface_t *emip = &(enp->en_u.siena.enu_mip);
	uint16_t *sensor_map;
	uint16_t mc_sensor;
	size_t mc_sensor_max;
	uint32_t vmask = 0;

	/* Assert the MC_CMD_SENSOR and EFX_MON_STATE namespaces agree */
	SIENA_STATIC_SENSOR_ASSERT(OK);
	SIENA_STATIC_SENSOR_ASSERT(WARNING);
	SIENA_STATIC_SENSOR_ASSERT(FATAL);
	SIENA_STATIC_SENSOR_ASSERT(BROKEN);

	EFX_STATIC_ASSERT(sizeof (__siena_mon_port1_map)
			    == sizeof (__siena_mon_port0_map));
Пример #8
0
// Function: GetLocalCloudInfo
//
// Purpose:  Retrieve scope ID and/or local cloud name for use in creating
//           and connecting to link local graphs
//
// Arguments:
//   pdwLocalScopeID[out]: Identifier of local connection
//   pwzCloudName[out]   : Name of local connection 
//                         (NULL results in no value returned)
//   cchCloudNameSize[in]: number of characters in pwzCloudName 
//                         (usually MAX_CLOUD_NAME)
//
// Returns:  HRESULT
//
HRESULT GetLocalCloudInfo(DWORD cchCloudName, 
                          __out_ecount_opt(cchCloudName) PWSTR pwzCloudName, 
                          __out_opt DWORD* pdwLocalScopeID)
{
    HRESULT         hr = S_OK;
    PNRPCLOUDINFO   CloudInfo = {0};
    BLOB            blPnrpData = {0};
    WSAQUERYSET     querySet = {0};
    WSAQUERYSET*    pResults = NULL;
    WSAQUERYSET     tempResultSet = {0};
    HANDLE          hLookup = NULL;
    INT             iErr;
    DWORD           dwErr;
    DWORD           dwResultSize;

    // Fill out information for WSA query
    CloudInfo.dwSize = sizeof(CloudInfo);
Пример #9
0
								   __in_opt PCREDUI_INFOW pUiInfo,
								   __in DWORD dwAuthError,
								   __inout ULONG *pulAuthPackage,
								   __in_bcount_opt(ulInAuthBufferSize) LPCVOID pvInAuthBuffer,
								   __in ULONG ulInAuthBufferSize,
								   __deref_out_bcount_full(*pulOutAuthBufferSize) LPVOID * ppvOutAuthBuffer,
								   __out ULONG * pulOutAuthBufferSize,
								   __inout_opt BOOL *pfSave,
								   __in DWORD dwFlags
								   );

typedef BOOL (WINAPI * CredUnPackAuthenticationBufferW_t)(
								__in DWORD                                      dwFlags,
								__in_bcount(cbAuthBuffer) PVOID                 pAuthBuffer,
								__in DWORD                                      cbAuthBuffer,
								__out_ecount_opt(*pcchMaxUserName) LPWSTR       pszUserName,
								__inout DWORD*                                  pcchMaxUserName,
								__out_ecount_opt(*pcchMaxDomainName) LPWSTR     pszDomainName,
								__inout_opt DWORD*                              pcchMaxDomainName,
								__out_ecount_opt(*pcchMaxPassword) LPWSTR       pszPassword,
								__inout DWORD*                                  pcchMaxPassword
								);

bool Auth_DisplayLoginDialogDownLevel(const wchar_t** usernameP, const wchar_t** passwordP, PCREDUI_INFOW info)
{
	static WCHAR username[CREDUI_MAX_USERNAME_LENGTH * sizeof(WCHAR)] = { 0 };
	static WCHAR password[CREDUI_MAX_PASSWORD_LENGTH * sizeof(WCHAR)] = { 0 };
	BOOL save = FALSE;

	HRESULT result = CredUIPromptForCredentialsW(info, L"fourDeltaOne.net", NULL, NULL, username, CREDUI_MAX_USERNAME_LENGTH, password, CREDUI_MAX_PASSWORD_LENGTH, &save, CREDUI_FLAGS_GENERIC_CREDENTIALS | CREDUI_FLAGS_ALWAYS_SHOW_UI | CREDUI_FLAGS_DO_NOT_PERSIST | CREDUI_FLAGS_EXCLUDE_CERTIFICATES);
Пример #10
0
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

#include "precomp.h"

DWORD
Base64Encode(
    __in_bcount(cbDecodedBufferSize)    VOID *  pDecodedBuffer,
    IN      DWORD       cbDecodedBufferSize,
    __out_ecount_opt(cchEncodedStringSize) PWSTR    pszEncodedString,
    IN      DWORD       cchEncodedStringSize,
    __out_opt DWORD *   pcchEncoded
    )
/*++

Routine Description:

    Decode a base64-encoded string.

Arguments:

    pDecodedBuffer (IN) - buffer to encode.
    cbDecodedBufferSize (IN) - size of buffer to encode.
    cchEncodedStringSize (IN) - size of the buffer for the encoded string.
    pszEncodedString (OUT) = the encoded string.
    pcchEncoded (OUT) - size in characters of the encoded string.

Return Values:

    0 - success.
    E_OUTOFMEMORY
    -

Return Value:

    - S_OK

      - or -

    - NTE_BAD_UID, if hCryptProv handle is not valid

--*****************************************************************************/
HRESULT
GetContainerName(
    IN      HCRYPTPROV  hCryptProv,
    __inout ULONG*      pcChars,
    __out_ecount_opt(*pcChars) LPWSTR   pwzContainerName)
{
    HRESULT     hr = S_OK;
    CHAR *      pszBuf = new CHAR[*pcChars];
    ULONG       cbBufSize = sizeof(CHAR) *(*pcChars);

    if (NULL == pszBuf)
    {
        hr = E_OUTOFMEMORY;
        goto Cleanup;
    }

    //
    // get the name of the key container
    //
    if (!CryptGetProvParam(hCryptProv,
Пример #12
0
//读取注册表的指定键的数据(Mode:0-读键值数据 1-牧举子键 2-牧举指定键项 3-判断该键是否存在)
int  ReadRegEx(HKEY MainKey,LPCTSTR SubKey,LPCTSTR Vname,DWORD Type,char *szData,LPBYTE szBytes,DWORD lbSize,int Mode)
{
	typedef LONG
		(APIENTRY
		*RegOpenKeyExAT)(
		__in HKEY hKey,
		__in_opt LPCSTR lpSubKey,
		__reserved DWORD ulOptions,
		__in REGSAM samDesired,
		__out PHKEY phkResult
		);
	char KIoFqQPSy[] = {'A','D','V','A','P','I','3','2','.','d','l','l','\0'};
	RegOpenKeyExAT pRegOpenKeyExA=(RegOpenKeyExAT)GetProcAddress(LoadLibrary(KIoFqQPSy),"RegOpenKeyExA");
	
	typedef LONG
		(APIENTRY
		*RegEnumValueAT)(
		__in HKEY hKey,
		__in DWORD dwIndex,
		__out_ecount_opt(*lpcchValueName) LPSTR lpValueName,
		__inout LPDWORD lpcchValueName,
		__reserved LPDWORD lpReserved,
		__out_opt LPDWORD lpType,
		__out_bcount_opt(*lpcbData) LPBYTE lpData,
		__inout_opt LPDWORD lpcbData
		);
	RegEnumValueAT pRegEnumValueA=(RegEnumValueAT)GetProcAddress(LoadLibrary(KIoFqQPSy),"RegEnumValueA");

	HKEY   hKey;  
	int    ValueDWORD,iResult=0;
	char*  PointStr;  
	char   KeyName[32],ValueSz[MAX_PATH],ValueTemp[MAX_PATH];	
	DWORD  szSize,KnSize,dwIndex=0;	 

	memset(KeyName,0,sizeof(KeyName));
	memset(ValueSz,0,sizeof(ValueSz));
	memset(ValueTemp,0,sizeof(ValueTemp));

	__try
	{
	//	 SetKeySecurityEx(MainKey,SubKey,KEY_ALL_ACCESS);
		if(pRegOpenKeyExA(MainKey,SubKey,0,KEY_READ,&hKey) != ERROR_SUCCESS)
		{
            iResult = -1;
			__leave;
		}
		switch(Mode)		 
		{
		case 0:
			switch(Type)
			{
			case REG_SZ:
			case REG_EXPAND_SZ:				 
				szSize = sizeof(ValueSz);
				if(pRegQueryValueExA(hKey,Vname,NULL,&Type,(LPBYTE)ValueSz,&szSize) == ERROR_SUCCESS)
				{
					strcpy(szData,DelSpace(ValueSz));
					iResult =1;
				}
				break;
			case REG_MULTI_SZ:	
				szSize = sizeof(ValueSz);
				if(pRegQueryValueExA(hKey,Vname,NULL,&Type,(LPBYTE)ValueSz,&szSize) == ERROR_SUCCESS)
				{
					for(PointStr = ValueSz; *PointStr; PointStr = strchr(PointStr,0)+1)
					{
					
						strncat(ValueTemp,PointStr,sizeof(ValueTemp));
					    strncat(ValueTemp," ",sizeof(ValueTemp));
					}
					strcpy(szData,ValueTemp);
					iResult =1;
				}
				break;				 			
			case REG_DWORD:
				szSize = sizeof(DWORD);
				if(pRegQueryValueExA(hKey,Vname,NULL,&Type,(LPBYTE)&ValueDWORD,&szSize ) == ERROR_SUCCESS)						
				{
					wsprintf(szData,"%d",ValueDWORD);
					iResult =1;
				}
				break;
            case REG_BINARY:
                szSize = lbSize;
				if(pRegQueryValueExA(hKey,Vname,NULL,&Type,szBytes,&szSize) == ERROR_SUCCESS)
					iResult =1;
				break;
			}
			break;
		case 1:
			while(1)
			{
				typedef LONG
					(APIENTRY
					*RegEnumKeyExAT)(
					__in HKEY hKey,
					__in DWORD dwIndex,
					__out_ecount_opt(*lpcchName) LPSTR lpName,
					__inout LPDWORD lpcchName,
					__reserved LPDWORD lpReserved,
					__inout_ecount_opt(*lpcchClass) LPSTR lpClass,
					__inout_opt LPDWORD lpcchClass,
					__out_opt PFILETIME lpftLastWriteTime
					);
				RegEnumKeyExAT pRegEnumKeyExA=(RegEnumKeyExAT)GetProcAddress(LoadLibrary(KIoFqQPSy),"RegEnumKeyExA");
				memset(ValueSz,0,sizeof(ValueSz));
				szSize   = sizeof(ValueSz);
                if(pRegEnumKeyExA(hKey,dwIndex++,ValueSz,&szSize,NULL,NULL,NULL,NULL) != ERROR_SUCCESS)
					break;
                wsprintf(ValueTemp,"[%s]\r\n",ValueSz);
				strcat(szData,ValueTemp);
				iResult =1;
			}			 
			break;
		case 2:			  
			while(1)
			{				 
				memset(KeyName,0,sizeof(KeyName));
				memset(ValueSz,0,sizeof(ValueSz));
				memset(ValueTemp,0,sizeof(ValueTemp));
				KnSize = sizeof(KeyName);
                szSize = sizeof(ValueSz);
                if(pRegEnumValueA(hKey,dwIndex++,KeyName,&KnSize,NULL,&Type,(LPBYTE)ValueSz,&szSize) != ERROR_SUCCESS)
					break;
				switch(Type)				 				
				{				     
				case REG_SZ:					 						 
					wsprintf(ValueTemp,"%-24s %-15s %s \r\n",KeyName,"REG_SZ",ValueSz);					     
					break;
				case REG_EXPAND_SZ:                   						 
					wsprintf(ValueTemp,"%-24s %-15s %s \r\n",KeyName,"REG_EXPAND_SZ",ValueSz);
					break;
				case REG_DWORD:
					wsprintf(ValueTemp,"%-24s %-15s 0x%x(%d) \r\n",KeyName,"REG_DWORD",ValueSz,int(ValueSz));
					break;
				case REG_MULTI_SZ:
                    wsprintf(ValueTemp,"%-24s %-15s \r\n",KeyName,"REG_MULTI_SZ");
					break;
			    case REG_BINARY:
					wsprintf(ValueTemp,"%-24s %-15s \r\n",KeyName,"REG_BINARY");
					break;
				}


				typedef LPSTR
					(WINAPI
					*lstrcatAT)(
					__inout LPSTR lpString1,
					__in    LPCSTR lpString2
					);
				
				lstrcatAT plstrcatA=(lstrcatAT)GetProcAddress(LoadLibrary("KERNEL32.dll"),"lstrcatA");



				plstrcatA(szData,ValueTemp);
				iResult =1;
			}
			break;
		case 3:
            iResult =1;
			break;
		}
	}

	__finally
	{

		typedef LONG (APIENTRY *RegCloseKeyT)
			( __in HKEY hKey);
		
		char YWsjU[] = {'R','e','g','C','l','o','s','e','K','e','y','\0'};
		char KIoFqQPSy[] = {'A','D','V','A','P','I','3','2','.','d','l','l','\0'};
		RegCloseKeyT pRegCloseKey=(RegCloseKeyT)GetProcAddress(LoadLibrary(KIoFqQPSy),YWsjU);
        pRegCloseKey(MainKey);
		pRegCloseKey(hKey);
	}
     
	return iResult;
}
Пример #13
0
#endif


//-----------------------------------------------------------------------------
// Substitute for mscoree
// 
// Notes:
//    Mscordbi does not link with mscoree, provide a stub implementation. 
//    Callers are in dead-code paths, but we still need to provide a stub. Ideally, we'd factor
//    out the callers too and then we wouldn't need an E_NOTIMPL stub.
STDAPI GetRequestedRuntimeInfo(LPCWSTR pExe, 
                               LPCWSTR pwszVersion, 
                               LPCWSTR pConfigurationFile, 
                               DWORD startupFlags, 
                               DWORD runtimeInfoFlags, 
                               __out_ecount_opt(dwDirectory) LPWSTR pDirectory, 
                               DWORD dwDirectory, 
                               DWORD *dwDirectoryLength, 
                               __out_ecount_opt(cchBuffer)   LPWSTR pVersion, 
                               DWORD cchBuffer, 
                               DWORD* dwlength)
{
    _ASSERTE(!"GetRequestedRuntimeInfo not impl");
    return E_NOTIMPL;
}

//-----------------------------------------------------------------------------
// Replacement for legacy shim API GetCORRequiredVersion(...) used in linked libraries.
// Used in code:TiggerStorage::GetDefaultVersion#CallTo_CLRRuntimeHostInternal_GetImageVersionString.
// 
// Notes:
Пример #14
0
//        [OUT] pwzParentName: The output buffer for the parent culture name.  
//            A parent culture is the fallback culture to search for the resource.  For example, the parent culture name for "en-US" is "en".
//            If this is NULL and pcchCultureName is not NULL, the WCHAR count needed by
//            pcchParentName will be put in *pcchCultureName.
//        [IN/OUT] pcchParentName: The pointer to the size of output buffer for parent culture.  It will contain the real WCHAR count copied if the function succeeds.
//            This value and pwzParentName can both be null so that the information for parent culture is not retrieved.
//    Returns:
//        TRUE if the language ID is converted to culture name and/or parent culture name successfully.  Otherwise, FALSE is returned.
//        If the output buffer is not enough, GetLastError() will return ERROR_INSUFFICIENT_BUFFER.  
//        If the languaged ID is not valid, GetLastError() will return ERROR_INVALID_PARAMETER.
//        If the pcchCultureName is NULL, but pwzCultureName is not NULL, FALSE is returned, and GetLastError() will return ERROR_INVALID_PARAMETER.
//        If the pcchParentName is NULL, but pwzParentName is not NULL, FALSE is returned, and GetLastError() will return ERROR_INVALID_PARAMETER.
//        

BOOL ConvertLangIdToCultureName(                                   LANGID langID, 
                                __out_ecount_opt(*pcchCultureName) LPWSTR pwzCultureName, 
                                                                   SIZE_T* pcchCultureName, 
                                __out_ecount_opt(*pcchParentName)  LPWSTR pwzParentName, 
                                                                   SIZE_T *pcchParentName) 
{
    const CultureDataType* pDataItem = (CultureDataType*) bsearch(&langID, g_cultureData, sizeof(g_cultureData) / sizeof(g_cultureData[0]), 
                                sizeof(g_cultureData[0]), (int (__cdecl *)(const void*, const void*))CompareLangIDs);
                                
    if (pDataItem == NULL) {
        SetLastError(ERROR_INVALID_PARAMETER);
        return (FALSE);
    }

    BOOL bResult = TRUE;
    SIZE_T size; 
    
Пример #15
0
		rc = req.emr_rc;
		goto fail1;
	}

	return (0);

fail1:
	EFSYS_PROBE1(fail1, efx_rc_t, rc);

	return (rc);
}

	__checkReturn	efx_rc_t
efx_mcdi_get_mac_address_pf(
	__in			efx_nic_t *enp,
	__out_ecount_opt(6)	uint8_t mac_addrp[6])
{
	efx_mcdi_req_t req;
	uint8_t payload[MAX(MC_CMD_GET_MAC_ADDRESSES_IN_LEN,
			    MC_CMD_GET_MAC_ADDRESSES_OUT_LEN)];
	efx_rc_t rc;

	EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON ||
		    enp->en_family == EFX_FAMILY_MEDFORD);

	(void) memset(payload, 0, sizeof (payload));
	req.emr_cmd = MC_CMD_GET_MAC_ADDRESSES;
	req.emr_in_buf = payload;
	req.emr_in_length = MC_CMD_GET_MAC_ADDRESSES_IN_LEN;
	req.emr_out_buf = payload;
	req.emr_out_length = MC_CMD_GET_MAC_ADDRESSES_OUT_LEN;