Bonsoir à tous !

Je voudrais créer un simple driver noyau implémentant la fonction HalMakeBeep(), voici les codes :

bip.c
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <ntddk.h>
 
NTSTATUS DriverEntry(IN PDRIVER_OBJECT  DriverObject, IN PUNICODE_STRING  RegistryPath);
 
#ifdef ALLOC_PRAGMA
#pragma alloc_text( INIT, DriverEntry )
#endif 
 
NTSTATUS DriverEntry(IN PDRIVER_OBJECT  DriverObject, IN PUNICODE_STRING  RegistryPath)
{
	INT32 i;
	HalMakeBeep(880);
	for(i=0; i<1000000; i++)
	{
	}
	HalMakeBeep(0);
	return STATUS_DEVICE_CONFIGURATION_ERROR;
}
sources:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
TARGETNAME=bip
TARGETTYPE=DRIVER
 
TARGETLIBS= \
 $(DDK_LIB_PATH)\hal.lib
 
SOURCES=bip.c
je lance build.exe (le makefile est présent) et tout compile parfaitement.
Je test le driver avec le programme suivant :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <windows.h>
 
int main()
{
	HANDLE hSCManager;
	HANDLE hService;
	char acDriverPath[MAX_PATH] = "";
 
	hSCManager = OpenSCManager(NULL,NULL,SC_MANAGER_CREATE_SERVICE);
	if(hSCManager != NULL)
	{
		GetFullPathName("bip.sys",MAX_PATH,acDriverPath,NULL);
		hService = CreateService(hSCManager,"bip","bipbip",SERVICE_START|DELETE,SERVICE_KERNEL_DRIVER,SERVICE_DEMAND_START,SERVICE_ERROR_IGNORE,acDriverPath,NULL,NULL,NULL,NULL,NULL);
 
		if(hService != NULL)
		{
			StartService(hService,0,NULL);
			DeleteService(hService);
			CloseServiceHandle(hService);
		}
 
		else
			MessageBox(NULL,"erreur service",NULL,MB_ICONSTOP);
 
	}
 
	else
		MessageBox(NULL,"erreur connexion",NULL,MB_ICONSTOP);
 
	return 0;
}
qui compile et lance bien le service... mais aucun son n'est produit !

Est-ce que quelqu'un pourrait m'aider svp ? C'est mon premier driver et je ne sais pas ce qui cloche