Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Aleksandr Isakov
wine-fonts
Commits
314fca4e
Commit
314fca4e
authored
Jan 14, 2015
by
Michael Müller
Committed by
Vitaly Lipatov
Jul 30, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nvapi: Add stub for NvAPI_GetLogicalGPUFromDisplay.
parent
cbbc5876
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
0 deletions
+62
-0
nvapi.c
dlls/nvapi/nvapi.c
+15
-0
nvapi.c
dlls/nvapi/tests/nvapi.c
+46
-0
nvapi.h
include/nvapi.h
+1
-0
No files found.
dlls/nvapi/nvapi.c
View file @
314fca4e
...
...
@@ -548,6 +548,20 @@ static NvAPI_Status CDECL NvAPI_D3D_GetCurrentSLIState(IUnknown *pDevice, NV_GET
return
NVAPI_NO_ACTIVE_SLI_TOPOLOGY
;
}
static
NvAPI_Status
CDECL
NvAPI_GetLogicalGPUFromDisplay
(
NvDisplayHandle
hNvDisp
,
NvLogicalGpuHandle
*
pLogicalGPU
)
{
TRACE
(
"(%p, %p)
\n
"
,
hNvDisp
,
pLogicalGPU
);
if
(
!
pLogicalGPU
)
return
NVAPI_INVALID_POINTER
;
if
(
hNvDisp
&&
hNvDisp
!=
FAKE_DISPLAY
)
return
NVAPI_NVIDIA_DEVICE_NOT_FOUND
;
*
pLogicalGPU
=
FAKE_LOGICAL_GPU
;
return
NVAPI_OK
;
}
void
*
CDECL
nvapi_QueryInterface
(
unsigned
int
offset
)
{
static
const
struct
...
...
@@ -587,6 +601,7 @@ void* CDECL nvapi_QueryInterface(unsigned int offset)
{
0x2926aaad
,
NvAPI_SYS_GetDriverAndBranchVersion
},
{
0xd22bdd7e
,
NvAPI_Unload
},
{
0x4b708b54
,
NvAPI_D3D_GetCurrentSLIState
},
{
0xee1370cf
,
NvAPI_GetLogicalGPUFromDisplay
},
};
unsigned
int
i
;
TRACE
(
"(%x)
\n
"
,
offset
);
...
...
dlls/nvapi/tests/nvapi.c
View file @
314fca4e
...
...
@@ -44,6 +44,7 @@ static NvAPI_Status (CDECL* pNvAPI_DISP_GetGDIPrimaryDisplayId)(NvU32* displayId
static
NvAPI_Status
(
CDECL
*
pNvAPI_EnumNvidiaDisplayHandle
)(
NvU32
thisEnum
,
NvDisplayHandle
*
pNvDispHandle
);
static
NvAPI_Status
(
CDECL
*
pNvAPI_SYS_GetDriverAndBranchVersion
)(
NvU32
*
pDriverVersion
,
NvAPI_ShortString
szBuildBranchString
);
static
NvAPI_Status
(
CDECL
*
pNvAPI_D3D_GetCurrentSLIState
)(
IUnknown
*
pDevice
,
NV_GET_CURRENT_SLI_STATE
*
pSliState
);
static
NvAPI_Status
(
CDECL
*
pNvAPI_GetLogicalGPUFromDisplay
)(
NvDisplayHandle
hNvDisp
,
NvLogicalGpuHandle
*
pLogicalGPU
);
static
const
struct
{
...
...
@@ -66,6 +67,7 @@ function_list[] =
{
0x9abdd40d
,
(
void
**
)
&
pNvAPI_EnumNvidiaDisplayHandle
},
{
0x2926aaad
,
(
void
**
)
&
pNvAPI_SYS_GetDriverAndBranchVersion
},
{
0x4b708b54
,
(
void
**
)
&
pNvAPI_D3D_GetCurrentSLIState
},
{
0xee1370cf
,
(
void
**
)
&
pNvAPI_GetLogicalGPUFromDisplay
},
};
static
BOOL
init
(
void
)
...
...
@@ -565,6 +567,49 @@ static void test_NvAPI_SYS_GetDriverAndBranchVersion(void)
trace
(
"Branch: %s
\n
"
,
branch
);
}
static
void
test_NvAPI_GetLogicalGPUFromDisplay
(
void
)
{
NvAPI_Status
status
;
NvDisplayHandle
disp
;
NvLogicalGpuHandle
gpuHandle
;
if
(
!
pNvAPI_GetLogicalGPUFromDisplay
)
{
win_skip
(
"NvAPI_SYS_GetDriverAndBranchVersion export not found.
\n
"
);
return
;
}
if
(
!
pNvAPI_EnumNvidiaDisplayHandle
)
{
win_skip
(
"NvAPI_EnumNvidiaDisplayHandle export not found.
\n
"
);
return
;
}
disp
=
NULL
;
status
=
pNvAPI_EnumNvidiaDisplayHandle
(
0
,
&
disp
);
ok
(
status
==
NVAPI_OK
,
"Expected status NVAPI_OK, got %d
\n
"
,
status
);
ok
(
disp
!=
NULL
,
"Expected disp to be non null
\n
"
);
status
=
pNvAPI_GetLogicalGPUFromDisplay
(
NULL
,
NULL
);
ok
(
status
==
NVAPI_INVALID_POINTER
,
"Expected status NVAPI_INVALID_POINTER, got %d
\n
"
,
status
);
status
=
pNvAPI_GetLogicalGPUFromDisplay
(
disp
,
NULL
);
ok
(
status
==
NVAPI_INVALID_POINTER
,
"Expected status NVAPI_INVALID_POINTER, got %d
\n
"
,
status
);
status
=
pNvAPI_GetLogicalGPUFromDisplay
((
void
*
)
0xdeadbeef
,
&
gpuHandle
);
ok
(
status
==
NVAPI_NVIDIA_DEVICE_NOT_FOUND
,
"Expected status NVAPI_NVIDIA_DEVICE_NOT_FOUND, got %d
\n
"
,
status
);
gpuHandle
=
NULL
;
status
=
pNvAPI_GetLogicalGPUFromDisplay
(
NULL
,
&
gpuHandle
);
ok
(
status
==
NVAPI_OK
,
"Expected status NVAPI_OK, got %d
\n
"
,
status
);
ok
(
gpuHandle
!=
NULL
,
"Expected gpuHandle to be non null
\n
"
);
gpuHandle
=
NULL
;
status
=
pNvAPI_GetLogicalGPUFromDisplay
(
disp
,
&
gpuHandle
);
ok
(
status
==
NVAPI_OK
,
"Expected status NVAPI_OK, got %d
\n
"
,
status
);
ok
(
gpuHandle
!=
NULL
,
"Expected gpuHandle to be non null
\n
"
);
}
static
IDirect3DDevice9
*
create_device
(
IDirect3D9
*
d3d9
,
HWND
focus_window
)
{
D3DPRESENT_PARAMETERS
present_parameters
=
{
0
};
...
...
@@ -678,6 +723,7 @@ START_TEST( nvapi )
test_NvAPI_DISP_GetGDIPrimaryDisplayId
();
test_NvAPI_EnumNvidiaDisplayHandle
();
test_NvAPI_SYS_GetDriverAndBranchVersion
();
test_NvAPI_GetLogicalGPUFromDisplay
();
/* d3d9 tests */
wc
.
lpfnWndProc
=
DefWindowProcA
;
...
...
include/nvapi.h
View file @
314fca4e
...
...
@@ -29,6 +29,7 @@ typedef unsigned int NvU32;
#define NVAPI_OK 0
#define NVAPI_ERROR -1
#define NVAPI_INVALID_ARGUMENT -5
#define NVAPI_NVIDIA_DEVICE_NOT_FOUND -6
#define NVAPI_END_ENUMERATION -7
#define NVAPI_INVALID_HANDLE -8
#define NVAPI_INCOMPATIBLE_STRUCT_VERSION -9
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment