mpr_main.c 2.41 KB
Newer Older
1 2
/*
 * MPR undocumented functions
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
 *
 * Copyright 1999 Ulrich Weigand
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 20
 */

21 22 23
#include <stdarg.h>

#include "windef.h"
24
#include "winbase.h"
25
#include "objbase.h"
26
#include "winnetwk.h"
27
#include "wine/debug.h"
28
#include "wnetpriv.h"
29

30
WINE_DEFAULT_DEBUG_CHANNEL(mpr);
31

32
 /*
33 34 35 36
  * FIXME: The following routines should use a private heap ...
  */

/*****************************************************************
Patrik Stridvall's avatar
Patrik Stridvall committed
37
 *  @  [MPR.22]
38 39 40
 */
LPVOID WINAPI MPR_Alloc( DWORD dwSize )
{
41
    return HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, dwSize );
42 43 44
}

/*****************************************************************
Patrik Stridvall's avatar
Patrik Stridvall committed
45
 *  @  [MPR.23]
46 47 48 49
 */
LPVOID WINAPI MPR_ReAlloc( LPVOID lpSrc, DWORD dwSize )
{
    if ( lpSrc )
50
        return HeapReAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, lpSrc, dwSize );
51
    else
52
        return HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, dwSize );
53 54 55
}

/*****************************************************************
Patrik Stridvall's avatar
Patrik Stridvall committed
56
 *  @  [MPR.24]
57 58 59 60
 */
BOOL WINAPI MPR_Free( LPVOID lpMem )
{
    if ( lpMem )
61
        return HeapFree( GetProcessHeap(), 0, lpMem );
62 63 64 65 66
    else
        return FALSE;
}

/*****************************************************************
Patrik Stridvall's avatar
Patrik Stridvall committed
67
 *  @  [MPR.25]
68 69 70 71 72 73 74 75
 */
BOOL WINAPI _MPR_25( LPBYTE lpMem, INT len )
{
    FIXME( "(%p, %d): stub\n", lpMem, len );

    return FALSE;
}

76 77 78
/*****************************************************************
 *  DllMain  [MPR.init]
 */
79 80 81 82 83 84 85 86 87 88 89 90 91 92
BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
    switch (fdwReason) {
        case DLL_PROCESS_ATTACH:
            DisableThreadLibraryCalls( hinstDLL );
            wnetInit(hinstDLL);
            break;

        case DLL_PROCESS_DETACH:
            wnetFree();
            break;
    }
    return TRUE;
}