Solved

Problems including winioctl.h....

Posted on 2003-10-22
2
714 Views
Last Modified: 2013-11-20
Hi,

my problem is this:
I use the function DeviceIoControl() with some parameters, and I have included winioctl.h, but the compiler can't find those parameters declared in that file. Here's the code:

#include "stdafx.h"
#include "windows.h"
#include "iostream.h"
#include "winioctl.h"

int main(int argc, char* argv[])
{
      HANDLE hFind;
      DWORD outputBufferSize;
      FILE_OBJECTID_BUFFER outputBuffer;

      ---
                some code here...(getting the handle etc.)
                ---

      DeviceIoControl(hFind,
                   FSCTL_GET_OBJECT_ID,
                   NULL,
                   0,
                   outputBuffer,
                   sizeof(outputBuffer),
                   outputBufferSize,
                   NULL);


      return 0;
}

and I get these error-messages:

error C2065: 'FILE_OBJECTID_BUFFER' : undeclared identifier
error C2146: syntax error : missing ';' before identifier 'outputBuffer'
error C2065: 'outputBuffer' : undeclared identifier
error C2065: 'FSCTL_GET_OBJECT_ID' : undeclared identifier

What can be the problem?? I have included winioctl.h, and I have the SDK include library as the top path in options/directories...(it finds windows.h without any problems)
Any help would be appreciated.

/Nick
0
Comment
Question by:Nick_72
2 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 75 total points
ID: 9597982
FILE_OBJECTID_BUFFER

Windows NT/2000 or later: Requires Windows 2000 or later.
Windows 95/98/Me: Unsupported.
Header: Declared in Winioctl.h.


This means you need to add the following line:

#include "stdafx.h"
#define _WIN32_WINNT 0x0500          // add this
#include "windows.h"
#include "iostream.h"
#include "winioctl.h"


See MSDN topic "Using the SDK Headers".




0
 
LVL 9

Author Comment

by:Nick_72
ID: 9598097
Oh....thanks alot.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now