csutil/threading/win32_apifuncs.h Source File (Crystal Space 2.0 Public API Reference)

| ## Public API Reference

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

csutil/threading/win32_apifuncs.h

    00001 /*
    00002   Copyright (C) 2006 by Marten Svanfeldt
    00003
    00004   This library is free software; you can redistribute it and/or
    00005   modify it under the terms of the GNU Lesser General Public
    00006   License as published by the Free Software Foundation; either
    00007   version 2 of the License, or (at your option) any later version.
    00008
    00009   This library is distributed in the hope that it will be useful,
    00010   but WITHOUT ANY WARRANTY; without even the implied warranty of
    00011   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00012   Library General Public License for more details.
    00013
    00014   You should have received a copy of the GNU Library General Public
    00015   License along with this library; if not, write to the Free
    00016   Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    00017 */
    00018
    00019 #ifndef __CS_CSUTIL_THREADING_WIN32_APIFUNCS_H__
    00020 #define __CS_CSUTIL_THREADING_WIN32_APIFUNCS_H__
    00021
    00022
    00023 namespace CS
    00024 {
    00025 namespace Threading
    00026 {
    00027 // Do our own private declarations of some win32 functions. This could
    00028 // potentially be dangerous, but as Microsoft haven't changed these since
    00029 // dawn of time, we will live with that.
    00030 namespace Implementation
    00031 {
    00032 #ifdef _WIN64
    00033   typedef uint64 ulong_ptr;
    00034 #else
    00035   typedef uint32 ulong_ptr;
    00036 #endif
    00037
    00038   extern "C"
    00039   {
    00040     __declspec(dllimport)
    00041     int __stdcall CloseHandle(void*);
    00042
    00043     __declspec(dllimport)
    00044     void* __stdcall CreateSemaphoreA(_SECURITY_ATTRIBUTES*,long,long,char const*);
    00045
    00046     __declspec(dllimport)
    00047     void* __stdcall GetCurrentProcess();
    00048
    00049     __declspec(dllimport)
    00050     unsigned long __stdcall GetCurrentProcessId();
    00051
    00052     __declspec(dllimport)
    00053     void* __stdcall GetCurrentThread();
    00054
    00055     __declspec(dllimport)
    00056     unsigned long __stdcall GetCurrentThreadId();
    00057
    00058     __declspec(dllimport)
    00059     int __stdcall DuplicateHandle(void*,void*,void*,void**,unsigned long,
    00060                                   int,unsigned long);
    00061
    00062     typedef void (__stdcall *queue_user_apc_callback_function)(ulong_ptr);
    00063     __declspec(dllimport)
    00064     unsigned long __stdcall QueueUserAPC(queue_user_apc_callback_function,
    00065                                           void*,ulong_ptr);
    00066
    00067     __declspec(dllimport)
    00068     int __stdcall ReleaseSemaphore(void*,long,long*);
    00069
    00070     __declspec(dllimport)
    00071     unsigned long __stdcall SleepEx(unsigned long,int);
    00072
    00073     __declspec(dllimport)
    00074     unsigned long __stdcall WaitForSingleObject(void*,unsigned long);
    00075
    00076   }
    00077
    00078 }
    00079 }
    00080 }
    00081
    00082 #endif