ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

BOOL WINAPI GetCurrentHwProfileA ( LPHW_PROFILE_INFOA  lpHwProfileInfo)

Definition at line 28 of file hwprofiles.c.

Referenced by SHGetMachineInfo().

{
    HW_PROFILE_INFOW ProfileInfo;
    UNICODE_STRING StringU;
    ANSI_STRING StringA;
    BOOL bResult;
    NTSTATUS Status;

    TRACE("GetCurrentHwProfileA() called\n");

    bResult = GetCurrentHwProfileW(&ProfileInfo);
    if (bResult == FALSE)
        return FALSE;

    lpHwProfileInfo->dwDockInfo = ProfileInfo.dwDockInfo;

    /* Convert the profile GUID to ANSI */
    StringU.Buffer = (PWCHAR)ProfileInfo.szHwProfileGuid;
    StringU.Length = wcslen(ProfileInfo.szHwProfileGuid) * sizeof(WCHAR);
    StringU.MaximumLength = HW_PROFILE_GUIDLEN * sizeof(WCHAR);
    StringA.Buffer = (PCHAR)&lpHwProfileInfo->szHwProfileGuid;
    StringA.Length = 0;
    StringA.MaximumLength = HW_PROFILE_GUIDLEN;
    Status = RtlUnicodeStringToAnsiString(&StringA,
                                          &StringU,
                                          FALSE);
    if (!NT_SUCCESS(Status))
    {
        SetLastError(RtlNtStatusToDosError(Status));
        return FALSE;
    }

    /* Convert the profile name to ANSI */
    StringU.Buffer = (PWCHAR)ProfileInfo.szHwProfileName;
    StringU.Length = wcslen(ProfileInfo.szHwProfileName) * sizeof(WCHAR);
    StringU.MaximumLength = MAX_PROFILE_LEN * sizeof(WCHAR);
    StringA.Buffer = (PCHAR)&lpHwProfileInfo->szHwProfileName;
    StringA.Length = 0;
    StringA.MaximumLength = MAX_PROFILE_LEN;
    Status = RtlUnicodeStringToAnsiString(&StringA,
                                          &StringU,
                                          FALSE);
    if (!NT_SUCCESS(Status))
    {
        SetLastError(RtlNtStatusToDosError(Status));
        return FALSE;
    }

    return TRUE;
}

Generated on Sat May 26 2012 05:04:57 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.