473,499 Members | 1,609 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Trying to read EDID directly from the monitor.

I am having this issue with both Visual C++ 6.0 and Visual Studio 2005 Beta
2. I have the SDK and DDK installed. I am trying to write a program to
retrieve the EDID for a specific monitor in a multi-monitor system. I
already know how to get this information from the registry, but I wish to get
the EDID from the monitor directly.

So far I have been unable to compile my program. The compiler generates
over 102 errors and 54 warnings, all of which seem to be from header files.
Below is a section of the code containing the two mentioned functions as well
as a sample of the error messages recieved from the build attempt.

I have included the headers ntddk.h and video.h and linked to the libraries
ntoskrnl.exe, wdm.lib, wdmsec.lib, and videoprt.lib. I believe my problems
stem from one or more of these.

There are two functions that I am using that require these headers/libraries:
1. IoGetDeviceObjectPointer
(http://msdn.microsoft.com/library/de...2c3471.xml.asp)

2. VideoPortDDCMonitorHelper
(http://msdn.microsoft.com/library/de...9be157.xml.asp)

Why won't it recognize the headers properly? Any thoughts on what is
causing these errors? Am I using the wrong headers, linking the wrong
libraries? Is there an easier way to do this?

Thank you for your time.
Code sample:
/* get device object name */
if (SetupDiGetDeviceRegistryProperty( //PDO
devInfoSet,
&devInfoData,
SPDRP_PHYSICAL_DEVICE_OBJECT_NAME,
NULL,
(PBYTE)(&PDO),
sizeof(PDO),
NULL))
{
fprintf_s(stdout, " PDO = %s\n", PDO);
sprintf_s(temp, sizeof(temp), " PDO = %s\n", PDO);
strcat_s(log, sizeof(log), temp);

/* get device object pointer */
if (IoGetDeviceObjectPointer(&PDO, FILE_READ_DATA, &fileObject,
&deviceObject)) {
fprintf_s(stdout, " Device object pointer obtained.\n");
strcat_s(log, sizeof(log), " Device object pointer obtained.\n");

/* get device extension pointer */
HwDeviceExtension = VideoPortGetAssociatedDeviceExtension(&deviceObjec t)
if (HwDeviceExtension != NULL) {
fprintf_s(stdout, " Device extension obtained.\n", PDO);
strcat_s(log, sizeof(log), " Device extension obtained.\n", PDO);

if (VideoPortDDCMonitorHelper(HwDeviceExtension, &DDCControl,
EDIDdata, sizeof(EDIDdata))) {
sprintf_s(regManID, sizeof(regManID), "");
sprintf_s(regProID, sizeof(regProID), "");
sprintf_s(regSerialA, sizeof(regSerialA), "");
sprintf_s(regSerialB, sizeof(regSerialB), "");
sprintf_s(regName, sizeof(regName), "");
fprintf_s(stdout, "\n EDID information\n");
strcat_s(log, sizeof(log), "\n EDID information\n");
for (i=8; i < 10; i++) { //Manufacturer ID (08h-09h)
sprintf_s(temp, sizeof(temp), "%02X ", EDIDdata);
strcat_s(regManID, sizeof(regManID), temp);
}

fprintf_s(stdout, " Manufacturer ID (hex) = %s \n", regManID);
sprintf_s(temp, sizeof(temp), " Manufacturer ID (hex) = %s \n",
regManID);
strcat_s(log, sizeof(log), temp);
}
}
}
}

Build output sample:
1>------ Build started: Project: loadLUT, Configuration: Debug Win32 ------

1>Compiling...

1>loadLUT.cpp

1>c:\winddk\2600.1106\inc\wxp\ntdef.h(81) : warning C4005:
'MAX_NATURAL_ALIGNMENT' : macro redefinition

1> c:\program files\microsoft visual studio
8\vc\platformsdk\include\winnt.h(53) : see previous definition of
'MAX_NATURAL_ALIGNMENT'

1>c:\winddk\2600.1106\inc\wxp\ntdef.h(108) : warning C4005:
'PROBE_ALIGNMENT' : macro redefinition

1> c:\program files\microsoft visual studio
8\vc\platformsdk\include\winnt.h(86) : see previous definition of
'PROBE_ALIGNMENT'

1>c:\winddk\2600.1106\inc\wxp\ntdef.h(134) : warning C4005: 'POINTER_64' :
macro redefinition

1> c:\program files\microsoft visual studio
8\vc\platformsdk\include\basetsd.h(36) : see previous definition of
'POINTER_64'

(SECTION ABBREVIATED)

1> c:\program files\microsoft visual studio
8\vc\platformsdk\include\winnt.h(2934) : see declaration of
'_FLOATING_SAVE_AREA'

1>c:\winddk\2600.1106\inc\ddk\wxp\ntddk.h(627) : error C2011: '_CONTEXT' :
'struct' type redefinition

1> c:\program files\microsoft visual studio
8\vc\platformsdk\include\winnt.h(2958) : see declaration of '_CONTEXT'

1>c:\winddk\2600.1106\inc\ddk\wxp\ntddk.h(1551) : error C2011:
'_GENERIC_MAPPING' : 'struct' type redefinition

1> c:\program files\microsoft visual studio
8\vc\platformsdk\include\winnt.h(3951) : see declaration of '_GENERIC_MAPPING'

1>c:\winddk\2600.1106\inc\ddk\wxp\ntddk.h(1572) : error C2011:
'_LUID_AND_ATTRIBUTES' : 'struct' type redefinition

(SECTION ABBREVIATED)

1>c:\winddk\2600.1106\inc\ddk\wxp\ntddk.h(2941) : fatal error C1003: error
count exceeds 100; stopping compilation

1>Build log was saved at
"file://c:\PMT\loadLUT2-1\_loadLUT\loadLUT\Debug\BuildLog.htm"

1>loadLUT - 102 error(s), 54 warning(s)

========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Nov 17 '05 #1
0 6955

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
2059
by: Rich Grise | last post by:
I think I've finally found a tutorial that can get me started: http://www.zib.de/Visual/people/mueller/Course/Tutorial/tutorial.html and I've been lurking for awhile as well. What happened is,...
4
2651
by: Jeff Rodriguez | last post by:
Main just loops over this while it's not null. The segfault occurs at this line: *line = (char)ch; Also, please don't just fix the code. I would like to know why exactly this isn't working so I...
0
1780
by: Robert | last post by:
After failing on a yield/iterator-continuation problem in Python (see below) I tried the Ruby (1.8.2) language first time on that construct: The example tries to convert a block callback interface...
62
3375
by: Bryan Dickerson | last post by:
Is there a way, with VS 2005 and FX 2.0, to read a given inbox? I need to write a 'monitor' program and my boss is convinced, as is always his first gut reaction, that we need to go buy a...
0
1405
by: Kristian Frost | last post by:
Hi, I'm just getting started with VB.Net, and I'm having trouble getting the routing around of some of the data straight in my mind, which has led me to the following problem. Basically, I'm...
7
13340
by: =?Utf-8?B?Sm9obi5ORVQ=?= | last post by:
Hi I have written a windows service in C# / .NET I have installed it and it's working fine on a couple boxes but on my XP box I get this error when I try to start it: Error 1053: The service did...
23
2971
by: asit dhal | last post by:
hello friends, can anyone explain me how to use read() write() function in C. and also how to read a file from disk and show it on the monitor using onlu read(), write() function ??????
4
5881
by: buu | last post by:
so, I have a private object as system.threading.AutoResetEvent, and I would like to read it's current status. currently I have an another boolean object wich I update together with an...
0
1275
by: lordfallout | last post by:
Is this possible? What I need is, to monitor the files of a virtual machine in real-time to check which VM is slowing down the system. I've researched for a program that can monitor the VM's...
0
7134
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7014
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7180
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7229
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6905
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5485
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3108
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3103
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
667
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.