Hi everyone,i'm tryng to retreive the serial number of a hard drive or a battery tag :    h[here is what i get when i compile it ][1]
   
   
       `#include "stdafx.h"     #include <stdio.h>    #include <stdlib.h>    #include <windows.h>    #include <string.h>    #include <process.h>    #include <WinIoCtl.h>    #include <Winbase.h>
   
       typedef struct _MEDIA_SERIAL_NUMBER_DATA { 	ULONG SerialNumberLength;
   	ULONG Result; 	ULONG Retreived; 	DWORD SerialNumberData[];    }MEDIA_SERIAL_NUMBER_DATA, *PMEDIA_SERIAL_NUMBER_DATA;  // the structure of IOCTL_MEDIA_SERIAL_NUMBER_DATA 
       int main() {
   
   	HANDLE hard;         	bool result; 	MEDIA_SERIAL_NUMBER_DATA  val;  
   	 	char buf[sizeof(MEDIA_SERIAL_NUMBER_DATA)];
   	MEDIA_SERIAL_NUMBER_DATA * p = (MEDIA_SERIAL_NUMBER_DATA *) buf;
   	                                                                  
       hard = CreateFile(L"\\\\.\\C:", 0, FILE_SHARE_WRITE, NULL,    OPEN_EXISTING, 0, 0);
       result = DeviceIoControl(hard, IOCTL_STORAGE_GET_MEDIA_SERIAL_NUMBER,    NULL, 0, buf, sizeof buf, 0, NULL);
   	
       if (hard == INVALID_HANDLE_VALUE) 
       printf("Terminal error : invalid handle value \n");
   
   		printf("valeur Handle : %c \n", hard);  		printf("valeur retour :    %d \n", result);  		printf("valeur serial : %d \n",    p->SerialNumberData);  		printf("valeur longeur num serie : %d \n",    p->SerialNumberLength);  		CloseHandle(hard); // free the Handle 	
   	system("pause"); 	return 0;
       }`

 1. List item

   
     [1]: https://i.stack.imgur.com/GvnJz.png