GetFirstApplication Method  
 
BOOL GetFirstApplication(
  LPWEB_STORAGE_APPLICATION lpAppInfo  
);

The GetFirstApplication method returns information about the first registered application for the current storage account.

Parameters

lpAppInfo
A pointer to a WEB_STORAGE_APPLICATION structure that will contain information about the registered application when the function returns. This parameter cannot be NULL.

Return Value

If the method succeeds, the return value is non-zero. If the method fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

The GetFirstApplication method returns information about the first registered application. It is used in conjunction with the GetNextApplication method to enumerate all of the registered application IDs associated with your storage account.

The cached application ID information used by this method is shared by the entire process. Attempting to enumerate all registered application IDs in multiple threads at the same time can yield unexpected results. It is recommended that multithreaded clients use a critical section to ensure that only a single thread is enumerating the AppIDs at any one time.

Example

WEB_STORAGE_APPLICATION webApp;

if (pStorage->GetFirstApplication(&webApp))
{
    do
    {
        // Print information for each registered application
        _tprintf(_T("AppId: %s\n"), webApp.szAppId);
        _tprintf(_T("Key: %s\n"), webApp.szApiKey);
        _tprintf(_T("LUID: %s\n"), webApp.szLuid);
        _tprintf(_T("Tokens: %lu\n"), webApp.dwTokens);
        _tprintf(_T("\n"));
    }
    while (pStorage->GetNextApplication(&webApp));
}

Requirements

Minimum Desktop Platform: Windows 7 Service Pack 1
Minimum Server Platform: Windows Server 2008 R2 Service Pack 1
Header File: cstools12.h
Import Library: cswebv12.lib
Unicode: Implemented as Unicode and ANSI versions

See Also