Skip to content

Commit

Permalink
Update headers for wine-staging-5.9
Browse files Browse the repository at this point in the history
  • Loading branch information
SveSop committed Jun 20, 2020
1 parent 735fd95 commit 0f42fc9
Show file tree
Hide file tree
Showing 26 changed files with 1,210 additions and 651 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
An attempt to build WINE's NvAPI implementation outside a WINE source tree.
Original source: https://github.com/pchome/wine-playground/tree/master/nvapi

Require nVidia proprietary driver version 440.x or newer
Requires nVidia proprietary driver version 440.x or newer

Some custom mods for driver version++

Expand Down
4 changes: 2 additions & 2 deletions build-wine32.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ strip = 'strip'
needs_exe_wrapper = true
winelib = true

c_args = ['-m32', '-march=native', '--no-gnu-unique', '-D__WINESRC__', '-Wno-attributes', '-Wno-implicit-function-declaration']
c_link_args = ['-m32', '-march=native', '-mwindows']
c_args = ['-m32', '--no-gnu-unique', '-D__WINESRC__', '-Wno-attributes', '-Wno-implicit-function-declaration']
c_link_args = ['-m32', '-mwindows']

[host_machine]
system = 'linux'
Expand Down
4 changes: 2 additions & 2 deletions build-wine64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ strip = 'strip'
needs_exe_wrapper = true
winelib = true

c_args = ['-m64', '-march=native', '--no-gnu-unique', '-D__WINESRC__', '-Wno-attributes', '-Wno-implicit-function-declaration']
c_link_args = ['-m64', '-march=native', '-mwindows']
c_args = ['-m64', '--no-gnu-unique', '-D__WINESRC__', '-Wno-attributes', '-Wno-implicit-function-declaration']
c_link_args = ['-m64', '-mwindows']

[host_machine]
system = 'linux'
Expand Down
1 change: 1 addition & 0 deletions dlls/nvapi/nvapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
*/

#include "config.h"
#include "wine/port.h"

#include <stdarg.h>
#include <stdio.h>
Expand Down
2 changes: 1 addition & 1 deletion dlls/nvcuda/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ nvcuda_res_target = custom_target('nvcuda.res',

nvcuda_dll = shared_library('nvcuda.dll', nvcuda_src,
name_prefix : '',
dependencies : [ thread_dep ],
dependencies : [ thread_dep, lib_dl ],
include_directories : include_path,
objects : 'nvcuda.spec',
install : true)
Expand Down
16 changes: 12 additions & 4 deletions dlls/nvcuda/nvcuda.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include "cuda.h"
#include "nvcuda.h"
#include "d3d9.h"
#include "dxgi.h"

#if defined(__x86_64) || defined(AMD64) || defined(_M_AMD64)
#define DEV_PTR "%llu"
Expand Down Expand Up @@ -427,7 +428,7 @@ static BOOL load_functions(void)

for (i = 0; i < sizeof(libname)/sizeof(libname[0]); i++)
{
cuda_handle = wine_dlopen(libname[i], RTLD_NOW, NULL, 0);
cuda_handle = dlopen(libname[i], RTLD_NOW);
if (cuda_handle) break;
}

Expand All @@ -437,8 +438,8 @@ static BOOL load_functions(void)
return FALSE;
}

#define LOAD_FUNCPTR(f) if((p##f = wine_dlsym(cuda_handle, #f, NULL, 0)) == NULL){FIXME("Can't find symbol %s\n", #f); return FALSE;}
#define TRY_LOAD_FUNCPTR(f) p##f = wine_dlsym(cuda_handle, #f, NULL, 0)
#define LOAD_FUNCPTR(f) if((p##f = dlsym(cuda_handle, #f)) == NULL){FIXME("Can't find symbol %s\n", #f); return FALSE;}
#define TRY_LOAD_FUNCPTR(f) p##f = dlsym(cuda_handle, #f)

LOAD_FUNCPTR(cuArray3DCreate);
LOAD_FUNCPTR(cuArray3DCreate_v2);
Expand Down Expand Up @@ -2958,6 +2959,13 @@ CUresult WINAPI wine_cuD3D9GetDevice(CUdevice *pCudaDevice, const char *pszAdapt
return pcuDeviceGet(pCudaDevice, 0);
}

CUresult WINAPI wine_cuD3D10GetDevice(CUdevice *pCudaDevice, IDXGIAdapter *pAdapter)
{
FIXME("(%p, %p) - semi-stub\n", pCudaDevice, pAdapter);
/* DXGI adapters don't have an OpenGL context assigned yet, otherwise we could use cuGLGetDevices */
return pcuDeviceGet(pCudaDevice, 0);
}

BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved)
{
TRACE("(%p, %u, %p)\n", instance, reason, reserved);
Expand All @@ -2969,7 +2977,7 @@ BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved)
break;
case DLL_PROCESS_DETACH:
if (reserved) break;
if (cuda_handle) wine_dlclose(cuda_handle, NULL, 0);
if (cuda_handle) dlclose(cuda_handle);
break;
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
Expand Down
1 change: 1 addition & 0 deletions dlls/nvcuvid/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ nvcuvid_res_target = custom_target('nvcuvid.res',
nvcuvid_dll = shared_library('nvcuvid.dll', nvcuvid_src,
name_prefix : '',
include_directories : include_path,
dependencies : [ lib_dl ],
objects : 'nvcuvid.spec',
install : true)

Expand Down
6 changes: 3 additions & 3 deletions dlls/nvcuvid/nvcuvid.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ static void *cuvid_handle = NULL;

static BOOL load_functions(void)
{
cuvid_handle = wine_dlopen("libnvcuvid.so", RTLD_NOW, NULL, 0);
cuvid_handle = dlopen("libnvcuvid.so", RTLD_NOW);

if (!cuvid_handle)
{
FIXME("Wine cannot find the libnvcuvid.so library, CUDA gpu decoding support disabled.\n");
return FALSE;
}

#define LOAD_FUNCPTR(f) if((p##f = wine_dlsym(cuvid_handle, #f, NULL, 0)) == NULL){FIXME("Can't find symbol %s\n", #f); return FALSE;}
#define LOAD_FUNCPTR(f) if((p##f = dlsym(cuvid_handle, #f)) == NULL){FIXME("Can't find symbol %s\n", #f); return FALSE;}

LOAD_FUNCPTR(cuvidCreateDecoder);
LOAD_FUNCPTR(cuvidCreateVideoParser);
Expand Down Expand Up @@ -529,7 +529,7 @@ BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved)
break;
case DLL_PROCESS_DETACH:
if (reserved) break;
if (cuvid_handle) wine_dlclose(cuvid_handle, NULL, 0);
if (cuvid_handle) dlclose(cuvid_handle);
break;
}

Expand Down
1 change: 1 addition & 0 deletions dlls/nvencodeapi/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ nvencodeapi_res_target = custom_target('nvencodeapi.res',
nvencodeapi_dll = shared_library('nvencodeapi.dll', nvencodeapi_src,
name_prefix : '',
include_directories : include_path,
dependencies : [ lib_dl ],
objects : 'nvencodeapi.spec',
install : true)

Expand Down
6 changes: 3 additions & 3 deletions dlls/nvencodeapi/nvencodeapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ static BOOL load_nvencode(void)

for (i = 0; i < sizeof(libname)/sizeof(libname[0]); i++)
{
libnvidia_encode_handle = wine_dlopen(libname[i], RTLD_NOW, NULL, 0);
libnvidia_encode_handle = dlopen(libname[i], RTLD_NOW);
if (libnvidia_encode_handle) break;
}

Expand All @@ -382,7 +382,7 @@ static BOOL load_nvencode(void)
return FALSE;
}

pNvEncodeAPICreateInstance = wine_dlsym(libnvidia_encode_handle, "NvEncodeAPICreateInstance", NULL, 0);
pNvEncodeAPICreateInstance = dlsym(libnvidia_encode_handle, "NvEncodeAPICreateInstance");
if (!pNvEncodeAPICreateInstance)
{
FIXME("Can't find symbol NvEncodeAPICreateInstance.\n");
Expand All @@ -405,7 +405,7 @@ BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved)
case DLL_PROCESS_DETACH:
if (reserved) break;
if (libnvidia_encode_handle)
wine_dlclose(libnvidia_encode_handle, NULL, 0);
dlclose(libnvidia_encode_handle);
break;
}

Expand Down
1 change: 1 addition & 0 deletions dlls/nvencodeapi64/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ nvencodeapi64_res_target = custom_target('nvencodeapi64.res',
nvencodeapi64_dll = shared_library('nvencodeapi64.dll', nvencodeapi64_src,
name_prefix : '',
include_directories : include_path,
dependencies : [ lib_dl ],
objects : 'nvencodeapi64.spec',
install : true)

Expand Down
51 changes: 51 additions & 0 deletions include/excpt.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* Copyright (C) 2002 Peter Hunnisett
*
* 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
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/

#ifndef __WINE_EXCPT_H
#define __WINE_EXCPT_H

/*
* Return values from the actual exception handlers
*/
typedef enum _EXCEPTION_DISPOSITION
{
ExceptionContinueExecution,
ExceptionContinueSearch,
ExceptionNestedException,
ExceptionCollidedUnwind
} EXCEPTION_DISPOSITION;

/*
* Return values from filters in except() and from UnhandledExceptionFilter
*/
#define EXCEPTION_EXECUTE_HANDLER 1
#define EXCEPTION_CONTINUE_SEARCH 0
#define EXCEPTION_CONTINUE_EXECUTION -1


#if defined(_MSC_VER) && defined(USE_COMPILER_EXCEPTIONS)
#define GetExceptionCode _exception_code
#define GetExceptionInformation (struct _EXCEPTION_POINTERS *)_exception_info
#define AbnormalTermination _abnormal_termination

unsigned long __cdecl _exception_code(void);
void * __cdecl _exception_info(void);
int __cdecl _abnormal_termination(void);
#endif /* defined(_MSC_VER) && defined(USE_COMPILER_EXCEPTIONS) */

#endif /* __WINE_EXCPT_H */
67 changes: 67 additions & 0 deletions include/threadpoolapiset.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
* Copyright 2019 Hans Leidekker for CodeWeavers
*
* 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
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/

#ifndef _THREADPOOLAPISET_H_
#define _THREADPOOLAPISET_H_

#ifdef __cplusplus
extern "C" {
#endif

typedef void (CALLBACK *PTP_WIN32_IO_CALLBACK)(PTP_CALLBACK_INSTANCE,PVOID,PVOID,ULONG,ULONG_PTR,PTP_IO);

WINBASEAPI void WINAPI CancelThreadpoolIo(TP_IO*);
WINBASEAPI void WINAPI CloseThreadpool(PTP_POOL);
WINBASEAPI void WINAPI CloseThreadpoolCleanupGroup(PTP_CLEANUP_GROUP);
WINBASEAPI void WINAPI CloseThreadpoolCleanupGroupMembers(PTP_CLEANUP_GROUP,BOOL,PVOID);
WINBASEAPI void WINAPI CloseThreadpoolIo(TP_IO*);
WINBASEAPI void WINAPI CloseThreadpoolTimer(PTP_TIMER);
WINBASEAPI void WINAPI CloseThreadpoolWait(PTP_WAIT);
WINBASEAPI void WINAPI CloseThreadpoolWork(PTP_WORK);
WINBASEAPI PTP_POOL WINAPI CreateThreadpool(PVOID);
WINBASEAPI PTP_CLEANUP_GROUP WINAPI CreateThreadpoolCleanupGroup(void);
WINBASEAPI PTP_IO WINAPI CreateThreadpoolIo(HANDLE,PTP_WIN32_IO_CALLBACK,PVOID,PTP_CALLBACK_ENVIRON);
WINBASEAPI PTP_TIMER WINAPI CreateThreadpoolTimer(PTP_TIMER_CALLBACK,PVOID,PTP_CALLBACK_ENVIRON);
WINBASEAPI PTP_WAIT WINAPI CreateThreadpoolWait(PTP_WAIT_CALLBACK,PVOID,PTP_CALLBACK_ENVIRON);
WINBASEAPI PTP_WORK WINAPI CreateThreadpoolWork(PTP_WORK_CALLBACK,PVOID,PTP_CALLBACK_ENVIRON);
WINBASEAPI void WINAPI DisassociateCurrentThreadFromCallback(PTP_CALLBACK_INSTANCE);
WINBASEAPI void WINAPI FreeLibraryWhenCallbackReturns(PTP_CALLBACK_INSTANCE,HMODULE);
WINBASEAPI BOOL WINAPI IsThreadpoolTimerSet(PTP_TIMER);
WINBASEAPI void WINAPI LeaveCriticalSectionWhenCallbackReturns(PTP_CALLBACK_INSTANCE,RTL_CRITICAL_SECTION*);
WINBASEAPI BOOL WINAPI QueryThreadpoolStackInformation(PTP_POOL,PTP_POOL_STACK_INFORMATION);
WINBASEAPI void WINAPI ReleaseMutexWhenCallbackReturns(PTP_CALLBACK_INSTANCE,HANDLE);
WINBASEAPI void WINAPI ReleaseSemaphoreWhenCallbackReturns(PTP_CALLBACK_INSTANCE,HANDLE,DWORD);
WINBASEAPI void WINAPI SetEventWhenCallbackReturns(PTP_CALLBACK_INSTANCE,HANDLE);
WINBASEAPI BOOL WINAPI SetThreadpoolStackInformation(PTP_POOL,PTP_POOL_STACK_INFORMATION);
WINBASEAPI void WINAPI SetThreadpoolThreadMaximum(PTP_POOL,DWORD);
WINBASEAPI BOOL WINAPI SetThreadpoolThreadMinimum(PTP_POOL,DWORD);
WINBASEAPI void WINAPI SetThreadpoolTimer(PTP_TIMER,FILETIME*,DWORD,DWORD);
WINBASEAPI void WINAPI SetThreadpoolWait(PTP_WAIT,HANDLE,FILETIME *);
WINBASEAPI void WINAPI StartThreadpoolIo(TP_IO*);
WINBASEAPI void WINAPI SubmitThreadpoolWork(PTP_WORK);
WINBASEAPI BOOL WINAPI TrySubmitThreadpoolCallback(PTP_SIMPLE_CALLBACK,void*,TP_CALLBACK_ENVIRON*);
WINBASEAPI void WINAPI WaitForThreadpoolIoCallbacks(TP_IO*,BOOL);
WINBASEAPI void WINAPI WaitForThreadpoolTimerCallbacks(PTP_TIMER,BOOL);
WINBASEAPI void WINAPI WaitForThreadpoolWaitCallbacks(PTP_WAIT,BOOL);
WINBASEAPI void WINAPI WaitForThreadpoolWorkCallbacks(PTP_WORK,BOOL);

#ifdef __cplusplus
}
#endif

#endif /* _THREADPOOLAPISET_H_ */
71 changes: 71 additions & 0 deletions include/timezoneapi.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/*
* Copyright (C) 2019 Daniel Lehman
*
* 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
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/

#ifndef _APISETTIMEZONE_
#define _APISETTIMEZONE_

#ifdef __cplusplus
extern "C" {
#endif

typedef struct _TIME_DYNAMIC_ZONE_INFORMATION
{
LONG Bias;
WCHAR StandardName[32];
SYSTEMTIME StandardDate;
LONG StandardBias;
WCHAR DaylightName[32];
SYSTEMTIME DaylightDate;
LONG DaylightBias;
WCHAR TimeZoneKeyName[128];
BOOLEAN DynamicDaylightTimeDisabled;
} DYNAMIC_TIME_ZONE_INFORMATION, *PDYNAMIC_TIME_ZONE_INFORMATION;

typedef struct _TIME_ZONE_INFORMATION
{
LONG Bias;
WCHAR StandardName[32];
SYSTEMTIME StandardDate;
LONG StandardBias;
WCHAR DaylightName[32];
SYSTEMTIME DaylightDate;
LONG DaylightBias;
} TIME_ZONE_INFORMATION, *PTIME_ZONE_INFORMATION, *LPTIME_ZONE_INFORMATION;

#define TIME_ZONE_ID_INVALID ((DWORD)0xFFFFFFFF)
#define TIME_ZONE_ID_UNKNOWN 0
#define TIME_ZONE_ID_STANDARD 1
#define TIME_ZONE_ID_DAYLIGHT 2

WINBASEAPI DWORD WINAPI EnumDynamicTimeZoneInformation(DWORD, DYNAMIC_TIME_ZONE_INFORMATION *);
WINBASEAPI DWORD WINAPI GetDynamicTimeZoneInformation(PDYNAMIC_TIME_ZONE_INFORMATION);
WINBASEAPI DWORD WINAPI GetDynamicTimeZoneInformationEffectiveYears(const DYNAMIC_TIME_ZONE_INFORMATION*,DWORD*,DWORD*);
WINBASEAPI DWORD WINAPI GetTimeZoneInformation(LPTIME_ZONE_INFORMATION);
WINBASEAPI BOOL WINAPI GetTimeZoneInformationForYear(USHORT,DYNAMIC_TIME_ZONE_INFORMATION*,TIME_ZONE_INFORMATION*);
WINBASEAPI BOOL WINAPI SetDynamicTimeZoneInformation(const DYNAMIC_TIME_ZONE_INFORMATION*);
WINBASEAPI BOOL WINAPI SetTimeZoneInformation(const TIME_ZONE_INFORMATION *);
WINBASEAPI BOOL WINAPI SystemTimeToTzSpecificLocalTime(const TIME_ZONE_INFORMATION*,const SYSTEMTIME*,LPSYSTEMTIME);
WINBASEAPI BOOL WINAPI SystemTimeToTzSpecificLocalTimeEx(const DYNAMIC_TIME_ZONE_INFORMATION*,const SYSTEMTIME*,LPSYSTEMTIME);
WINBASEAPI BOOL WINAPI TzSpecificLocalTimeToSystemTime(const TIME_ZONE_INFORMATION*,const SYSTEMTIME*,LPSYSTEMTIME);
WINBASEAPI BOOL WINAPI TzSpecificLocalTimeToSystemTimeEx(const DYNAMIC_TIME_ZONE_INFORMATION*,const SYSTEMTIME*,LPSYSTEMTIME);

#ifdef __cplusplus
}
#endif

#endif /* _APISETTIMEZONE_ */
Loading

0 comments on commit 0f42fc9

Please sign in to comment.