/*******************************************************************

Copyright (c) 2004 Open Mobile Alliance, Ltd.  All Rights Reserved.

This software is made available under the usage and distribution terms 
covered by the Common Public License 1.0 and by using this software you
are bound by the terms and conditions of the same.

EXCEPT AS EXPRESSLY SET FORTH IN THE COMMON PUBLIC LICENSE,
THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, 
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 
EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, 
ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, 
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
   
Each recipient is solely responsible for determining the 
appropriateness of using and distributing this program and assumes 
all risks associated with its exercise of rights under the Common 
Public License, including but not limited to the risks and 
costs of program errors, compliance with applicable laws, 
damage to or loss of data, programs or equipment, and 
unavailability or interruption of operations.

********************************************************************/
/*************************************************************************/
/* module:          SyncML HTTP protocol driver                          */
/* file:            src/xpt/win/xptihttp.h                               */
/* target system:   win                                                  */
/* target OS:       win                                                  */
/*************************************************************************/



/**
 * This module contains Windows specific definitions for the
 * HTTP protocol handler for SyncML
 * invokes the miscellaneous protocol drivers.
 *
 */

#define WIN32_LEAN_AND_MEAN		// Exclude rarely-used stuff from Windows headers
#include <windows.h>
#include <stddef.h>
#include <memory.h>

#include "xptmutex.h"


typedef HANDLE Mutex_t;

MutexPtr_t newMutex() {
    return (MutexPtr_t) CreateMutex( NULL, FALSE, NULL );
}

void       freeMutex( MutexPtr_t m ) {
    CloseHandle( m );
}

void       lockMutex( MutexPtr_t m ) {
    WaitForSingleObject( m, INFINITE );
}

void       unlockMutex( MutexPtr_t m ) {
    ReleaseMutex( m );
}
