A
download unsafe.h
Language: C
Copyright: (c) 2006 Microsoft Corporation. All rights reserved.
LOC: 70
Project Info
Rotor IL Logger(rotorillogger)
Server: CodePlex1
Type: svn
...orillogger\svn\clr\src\inc\
   allocacheck.h
   apithreadstress.cpp
   apithreadstress.h
   arraylist.h
   assemblyfilehash.h
   bbsweep.h
   bitmask.h
   bitmask.inl
   blobfetcher.h
   cahlpr.h
   ceefilegenwriter.h
   ceegen.h
   ceegentokenmapper.h
   ceesectionstring.h
   check.h
   check.inl
   circularlog.h
   classfac.h
   clrdata.idl
   clrhost.h
   clrinternal.idl
   clrntexception.h
   clrtypes.h
   columnbinding.h
   compatibilityflags.h
   compatibilityflagsdef.h
   contract.h
   contract.inl
   contxt.h
   cor.h
   cordbpriv.h
   cordebug.idl
   corerror.h
   corexcep.h
   corffi.idl
   corhdr.h
   corhlpr.cpp
   corhlpr.h
   corhost.h
   corimage.h
   corinfo.h
   corjit.h
   corperfmonsymbols.h
   corperm.h
   corperme.h
   corpermp.h
   corpolicy.h
   corpriv.h
   corprof.idl
   corpub.idl
   cortpoolhdr.h
   cortypeinfo.h
   crstlevels.h
   crtwrap.h
   daccess.h
   dacprivate.h
   dacvars.h
   dbgalloc.h
   dbgmeta.h
   debugmacros.h
   debugmacrosext.h
   debugreturn.h
   declsec.h
   dlwrap.h
   eetwain.h
   eexcp.h
   enc.h
   entrypoints.h
   eventtrace.h
   ex.h
   factory.h
   factory.inl
   fusion.idl
   fusionbind.h
   fusionpriv.idl
   fusionsetup.h
   fusionsink.h
   gcdecoder.cpp
   gcdump.h
   gchost.idl
   gcinfo.h
   genericstackprobe.h
   genrops.pl
   guidfromname.h
   holder.h
   holderinst.h
   hrex.h
   iceefilegen.h
   il_kywd.h
   ilformatter.h
   internaldebug.h
   intrinsic.h
   ipcfunccall.h
   ipcmanagerinterface.h
   iterator.h
   ivalidator.idl
   ivehandler.idl
   jithelpers.h
   jitperf.h
   loaderheap.h
   log.h
   loglf.h
   machine.h
   makefile.inc
   md5.h
   mdcommon.h
   memorypool.h
   memoryreport.h
   metadata.h
   metadatatracker.h
   metamodelpub.h
   mscorcfg.h
   mscoree.idl
   nativevaraccessors.h
   new.hpp
   nibblemapmacros.h
   nibblestream.h
   nsutilpriv.h
   opcode.def
   openum.h
   opinfo.h
   ostype.h
   outstring.h
   palclr.h
   pedecoder.h
   pedecoder.inl
   perfcounterdefs.h
   perfcounters.h
   perflog.h
   pesectionman.h
   posterror.h
   predeftlsslot.h
   prettyprintsig.h
   priorityqueue.h
   priorityqueue.inl
   profiledatastore.h
   profilepriv.h
   querybinding.h
   rangetree.h
   regdisp.h
   safecast.h
   safegetfilesize.h
   safemath.h
   safewrap.h
   sarray.h
   sarray.inl
   sbuffer.h
   sbuffer.inl
   securitywrapper.h
   setupcodes.h
   shash.h
   shash.inl
   shimload.h
   sighelper.h
   sigparser.h
   sstring.h
   sstring.inl
   stackframe.h
   stacktrace.h
   staticcontract.h
   stdmacros.h
   stgpool.h
   stgpooli.h
   stresslog.h
   strongname.h
   switches.h
   testhook.h
   threadpool.h
   timeline.h
   timer.h
   tls.h
   unsafe.h
   utilcode.h
   utsem.h
   vererror.h
   vptr_list.h
   warningcontrol.h
   winwrap.h
   wsinfo.h
   xclrdata.idl
   xmlparser.h

// ==++==
// 
//   
//    Copyright (c) 2006 Microsoft Corporation.  All rights reserved.
//   
//    The use and distribution terms for this software are contained in the file
//    named license.txt, which can be found in the root of this distribution.
//    By using this software in any fashion, you are agreeing to be bound by the
//    terms of this license.
//   
//    You must not remove this notice, or any other, from this software.
//   
// 
// ==--==                                                      

#ifndef __UNSAFE_H__
#define __UNSAFE_H__

// should we just check proper inclusion?
#include <winwrap.h>
#include "staticcontract.h"

inline VOID UnsafeEnterCriticalSection(LPCRITICAL_SECTION lpCriticalSection)
{
    STATIC_CONTRACT_LEAF;
    EnterCriticalSection(lpCriticalSection);
}

inline VOID UnsafeLeaveCriticalSection(LPCRITICAL_SECTION lpCriticalSection)
{
    STATIC_CONTRACT_LEAF;
    LeaveCriticalSection(lpCriticalSection);
}

inline VOID UnsafeInitializeCriticalSection(LPCRITICAL_SECTION lpCriticalSection)
{
    STATIC_CONTRACT_LEAF;
    InitializeCriticalSection(lpCriticalSection);
}

inline VOID UnsafeDeleteCriticalSection(LPCRITICAL_SECTION lpCriticalSection)
{
    STATIC_CONTRACT_LEAF;
    DeleteCriticalSection(lpCriticalSection);
}

inline HANDLE UnsafeCreateEvent(LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset, BOOL bInitialState, LPCWSTR lpName)
{
    STATIC_CONTRACT_WRAPPER;
    return WszCreateEvent(lpEventAttributes, bManualReset, bInitialState, lpName);
}

inline BOOL UnsafeSetEvent(HANDLE hEvent)
{
    STATIC_CONTRACT_LEAF;
    return SetEvent(hEvent);
}

inline BOOL UnsafeResetEvent(HANDLE hEvent)
{
    STATIC_CONTRACT_LEAF;
    return ResetEvent(hEvent);
}

inline HANDLE UnsafeCreateSemaphore(LPSECURITY_ATTRIBUTES lpSemaphoreAttributes, LONG lInitialCount, LONG lMaximumCount, LPCWSTR lpName)
{
    STATIC_CONTRACT_WRAPPER;
    return WszCreateSemaphore(lpSemaphoreAttributes, lInitialCount, lMaximumCount, lpName);
}

inline BOOL UnsafeReleaseSemaphore(HANDLE hSemaphore, LONG lReleaseCount, LPLONG lpPreviousCount)
{
    STATIC_CONTRACT_LEAF;
    return ReleaseSemaphore(hSemaphore, lReleaseCount, lpPreviousCount);
}

inline LPVOID UnsafeTlsGetValue(DWORD dwTlsIndex)
{
    STATIC_CONTRACT_LEAF;
    return TlsGetValue(dwTlsIndex);
}

inline BOOL UnsafeTlsSetValue(DWORD dwTlsIndex, LPVOID lpTlsValue)
{
    STATIC_CONTRACT_LEAF;
    return TlsSetValue(dwTlsIndex, lpTlsValue);
}

inline DWORD UnsafeTlsAlloc(void) 
{
    STATIC_CONTRACT_LEAF;
    return TlsAlloc();
}

inline BOOL UnsafeTlsFree(DWORD dwTlsIndex) 
{
    STATIC_CONTRACT_LEAF;
    return TlsFree(dwTlsIndex);
}

#endif


About Koders | Resources | Downloads | Support | Black Duck | Terms of Service | DMCA | Privacy Policy | Contact Us