|
He got as far as opening a new cpp file....
==============================
Nothing to say.
|
|
|
|
|
hi
i was implemented ICredentialProviderFilter in my custom credential provider it is switch user button not showing. ie: it is showing only my custom credential provider it is not showing my other credentials please help me anyone
|
|
|
|
|
Hi, I have a C file which contains a simple DbgPrint in DriverEntry but, when I build my project, I get 9 errors like C:\drvtest\src\testdriver.c : error CS2059: Syntax Error : ';'
C:\drvtest\src\testdriver.c : error CS2059: Syntax Error : 'type'
C:\drvtest\src\testdriver.c : error CS2059: Syntax Error : identifier DriverDispatch
I use WDK and CodeBlocks as a C compiler.
What is the problem? Please help. Thanks.
|
|
|
|
|
Without seeing the actual code it is not easy to guess why you are seeing these syntax errors.
Use the best guess
|
|
|
|
|
My code is below;
#include "ntddk.h"
NTSTATUS STDCALL DriverDispatch(IN PEDEVICE_OBJECT DeviceObject, IN PIRP Irp)
{
return STATUS_SUCCESS;
}
VOID STDCALL DriverUnload(IN PDRIVER_OBJECT DriverObject)
{
DbgPrint("Driver_Unload");
}
NTSTATUS STDCALL DriverEntry(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegisterPath)
{
DbgPrint("Driver_Entry");
DriverObject->DriverUnload=DriverUnload;
return STATUS_SUCCESS;
}
Thanks.
|
|
|
|
|
Which line gives the error?
Use the best guess
|
|
|
|
|
When I build the file, all the lines gives error. I think configuration files have errors. SOURCES and MAKEFILE. Thanks for your replies.
|
|
|
|
|
Sorry, I have no idea what that means, but I suspect you are missing some essential component in your build configuration.
Use the best guess
|
|
|
|
|
So show us the SOURCES file.
==============================
Nothing to say.
|
|
|
|
|
I'm not sure if this helps. But you may try (for all functions):
NTSTATUS STDCALL DriverDispatch(IN PEDEVICE_OBJECT DeviceObject, IN PIRP Irp);
NTSTATUS DriverDispatch(IN PEDEVICE_OBJECT DeviceObject, IN PIRP Irp)
{
return STATUS_SUCCESS;
}
|
|
|
|
|
No, you dont want to mess with that, leave the compiler do its thing.
==============================
Nothing to say.
|
|
|
|
|
Have you included windows.h (or equivalent)?
Have you tried commenting out statements until the compiler errors go away, and then introduce them back one by one until the compiler errors show up?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
DavidCrow wrote: Have you included windows.h ?
In a driver? He needs wdm.h unles he is building an NT4 style driver.
==============================
Nothing to say.
|
|
|
|
|
Good job you cant build it because it will BSOD anyway.
You need to do this for starters in DriverEntry:
for (Index = 0 ; Index <= IRP_MJ_MAXIMUM_FUNCTION ; Index++)
{
DriverObject->MajorFunction[Index] = MyDispatch;
}
DriverObject->DriverExtension->AddDevice = 0;
DriverObject->DriverUnload = MyUnload;
Your MyDispatch actually needs to do something with the Irps, set Information to 0, the status block to success and return success.
Irp->IoStatus.Status = STATUS_SUCCESS;
Irp->IoStatus.Information = 0;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return STATUS_SUCCESS;
You then need to make sure you are using the DDK (of WDK) compiler, as in actually install the entire DDK (WDK). I dont know what CodeBlocks is, I dont care, the DDK compiler is the one you must use.
You need to get your SORCES file right, look at some of the samples that ship with the DDK (WDK).
You then need a service entry in the registry in order to start your driver, either inf file or do it manually, then start it with 'net srart'.
==============================
Nothing to say.
|
|
|
|
|
Hi all I want to convert the following code of MATLAB in c can any expert can help me?
thanks in advance
%ICA START
data1=[a;b;c];
MEANMAT=repmat(mean(data1')',1,length(data1));
c1=cov(data1');
[T1,E1]=eig(c1);
data2=T1'*(data1-MEANMAT);
%data2=T1*(data1);
c2=cov(data2');
[T2,E2]=eig(c2);
data=E2^(-1/2)*data2;
T=E2^(-1/2)*T1;
c=cov(data');
|
|
|
|
|
what does that Matlab code do?
|
|
|
|
|
Hi, I am trying to call Win32 API from Windows Store App. Since Win32 APIs can not be accessed from WinRT, I have written a Win32 Dll and exposed a function.
I am trying to call this function from WinRT App. But I am getting 'Access Denied' Error.
Dll Code:
extern "C" __declspec( dllexport )INT32 ScanWlan()
{
HANDLE hClient = NULL;
DWORD dwError = ERROR_SUCCESS;
DWORD dwMaxClient = 2;
DWORD dwCurVersion = 0;
DWORD dwResult = 0;
dwResult = WlanOpenHandle(dwMaxClient, NULL, &dwCurVersion, &hClient);
if (dwResult != ERROR_SUCCESS)
{
WlanCloseHandle(hClient, NULL);
wprintf(L"WlanOpenHandle failed with error: %u\n", dwResult);
return 1;
}
I am able to call this funtion from WinRT App. But 'WlanOpenHandle' function failed with error 5 (ERROR_ACCESS_DENIED).
I have done this using administrator login also. But still I am getting the same error.
Am I doing the right thing?
Can We access Win32 APIs from WinRT Apps through Dlls (at least).
Any help?
Thank you,
Sai
|
|
|
|
|
The value in dwMaxClient is incorrect. It should be a composite value constructed with the WLAN_API_MAKE_VERSION() macro, as described in the documentation[^].
Use the best guess
|
|
|
|
|
Hi Richard MacCutchan, thank you for your reply.
I changed my code like this.
dwResult = WlanOpenHandle(WLAN_API_MAKE_VERSION(2, 0), NULL, &dwCurVersion, &hClient);
But still its throwing the same error.
Basically I'm trying to find Wi-Fi n/w interfaces and trying to get available Wi-Fi access points.
If I run this code from a pure Win32 application, I am able to get the interfaces and Wi-Fi access points.
But not working from WinRT App.
Regards
Sai
|
|
|
|
|
If you use a DLL, that DLL is loaded into your WinRT process space and shares the same security context as the WinRT apps. In other words, you cannot 'escape the sandbox' via a DLL.
Unfortunately, I have no experience with programming WinRT, so I can not present you with a solution, only an answer as to why this will not work.
|
|
|
|
|
Hi Micro Virus, thanks for your reply.
I want to know are there any APIs available in WinRT to
1) Find WLAN interaface list (Win32 API - WlanEnumInterfaces)
2) Find Wi-Fi access points (Win32 API - WlanGetAvailableNetworkList)
Basically I am trying to write an WinRT application to do all these.
Any help?
Regards,
Sai
|
|
|
|
|
|
I have an old Borland C++ project that displayed a 16 x 16 group of labels displaying 0x00 to 0xFF for the purpose of diagnostics.
I am now using MicroSoft Visual Studio 2010 C++
I am having a problem creating an array of labels at runtime that the labels are accessable by other routines such as a timer interval routine
<pre lang="c++">
#pragma once
#include <stdio.h>
namespace SerialTester {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
/// <summary>
/// Summary for Form1
int count;
int tindex;
/// </summary>
public ref class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
InitializeComponent();
count = 0;
tindex = 0;
char buffer[200];
array< Label ^ > ^ labels;
labels = gcnew array<Label^>(256);
for (int index = 0; index < 256; ++index)
{
Label ^ label = gcnew Label;
Controls->Add(label);
labels[index] = label;
}
}
protected:
/// <summary>
private: System::Void timer1_Tick(System::Object^ sender, System::EventArgs^ e)
{
labels[tindex++]->BackColor = ....... ; }
}
So when I create the form I created an array of 256 Labels at runtime, labels[x] but in the timer1_Tick I can not access them because the array is not global.
QUESTION: How can I do this, should my creation be somewheres else so that it is global.
Any help from anyone would be greatly appriciated.
Or a link to a tutorial on this.
Thank you in advance
Douglas
modified 31-Mar-13 18:38pm.
|
|
|
|
|
Please don't post the same question in multiple places; you already posted this in the Managed C++ forum.
Use the best guess
|
|
|
|
|
Hello
Sorry not sure which section or fourm applies.
After not getting a response in one I thought perhaps the other was more appropiate.
Are you able to offer anything to the problem or am I simply on the wrong site.
Thank in advance
Douglas
|
|
|
|