Ignore:
Timestamp:
Apr 29, 2001, 12:30:59 PM (24 years ago)
Author:
sandervl
Message:

wine resync

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/comctl32/comctl32undoc.cpp

    r5416 r5630  
    1 /* $Id: comctl32undoc.cpp,v 1.8 2001-03-31 13:25:26 sandervl Exp $ */
     1/* $Id: comctl32undoc.cpp,v 1.9 2001-04-29 10:30:56 sandervl Exp $ */
    22/*
    33 * Undocumented functions from COMCTL32.DLL
     
    25452545}
    25462546
    2547 
     2547/**************************************************************************
     2548 * COMCTL32_415 [COMCTL32.415]
     2549 *
     2550 * FIXME: What's this supposed to do?
     2551 *        Parameter 1 is an HWND, you're on your own for the rest.
     2552 */
     2553
     2554BOOL WINAPI COMCTL32_415( HWND hwnd, DWORD b, DWORD c, DWORD d, DWORD e)
     2555{
     2556
     2557   FIXME("(%x, %lx, %lx, %lx, %lx): stub!\n", hwnd, b, c, d, e);
     2558
     2559   return TRUE;
     2560}
     2561
     2562/**************************************************************************
     2563 * Str_GetPtrWtoA [internal]
     2564 *
     2565 * Converts a unicode string into a multi byte string
     2566 *
     2567 * PARAMS
     2568 *     lpSrc   [I] Pointer to the unicode source string
     2569 *     lpDest  [O] Pointer to caller supplied storage for the multi byte string
     2570 *     nMaxLen [I] Size, in bytes, of the destination buffer
     2571 *
     2572 * RETURNS
     2573 *     Length, in bytes, of the converted string.
     2574 */
     2575
     2576INT
     2577Str_GetPtrWtoA (LPCWSTR lpSrc, LPSTR lpDest, INT nMaxLen)
     2578{
     2579    INT len;
     2580
     2581    TRACE("(%s %p %d)\n", debugstr_w(lpSrc), lpDest, nMaxLen);
     2582
     2583    if (!lpDest && lpSrc)
     2584        return WideCharToMultiByte(CP_ACP, 0, lpSrc, -1, 0, 0, NULL, NULL);
     2585
     2586    if (nMaxLen == 0)
     2587        return 0;
     2588
     2589    if (lpSrc == NULL) {
     2590        lpDest[0] = '\0';
     2591        return 0;
     2592    }
     2593
     2594    len = WideCharToMultiByte(CP_ACP, 0, lpSrc, -1, 0, 0, NULL, NULL);
     2595    if (len >= nMaxLen)
     2596        len = nMaxLen - 1;
     2597
     2598    WideCharToMultiByte(CP_ACP, 0, lpSrc, -1, lpDest, len, NULL, NULL);
     2599    lpDest[len] = '\0';
     2600
     2601    return len;
     2602}
     2603
     2604
     2605/**************************************************************************
     2606 * Str_SetPtrAtoW [internal]
     2607 *
     2608 * Converts a multi byte string to a unicode string.
     2609 * If the pointer to the destination buffer is NULL a buffer is allocated.
     2610 * If the destination buffer is too small to keep the converted multi byte
     2611 * string the destination buffer is reallocated. If the source pointer is
     2612 * NULL, the destination buffer is freed.
     2613 *
     2614 * PARAMS
     2615 *     lppDest [I/O] pointer to a pointer to the destination buffer
     2616 *     lpSrc   [I] pointer to a multi byte string
     2617 *
     2618 * RETURNS
     2619 *     TRUE: conversion successful
     2620 *     FALSE: error
     2621 */
     2622
     2623BOOL
     2624Str_SetPtrAtoW (LPWSTR *lppDest, LPCSTR lpSrc)
     2625{
     2626    TRACE("(%p %s)\n", lppDest, lpSrc);
     2627
     2628    if (lpSrc) {
     2629        INT len = MultiByteToWideChar(CP_ACP,0,lpSrc,-1,NULL,0);
     2630        LPWSTR ptr = (LPWSTR)COMCTL32_ReAlloc (*lppDest, len*sizeof(WCHAR));
     2631
     2632        if (!ptr)
     2633            return FALSE;
     2634        MultiByteToWideChar(CP_ACP,0,lpSrc,-1,ptr,len);
     2635        *lppDest = ptr;
     2636    }
     2637    else {
     2638        if (*lppDest) {
     2639            COMCTL32_Free (*lppDest);
     2640            *lppDest = NULL;
     2641        }
     2642    }
     2643
     2644    return TRUE;
     2645}
Note: See TracChangeset for help on using the changeset viewer.