3 Replies - 2415 Views - Last Post: 27 April 2015 - 05:06 AM Rate Topic: -----

#1 little_prince41   User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 163
  • Joined: 10-August 07

How to get serial number harddisk in WinCE ?

Posted 25 April 2015 - 07:58 PM

Hello

I want to get serial number of harddisk in WinCE . I saw many people using "System.Management.dll" it's easy but in WinCE I can't find method.
Can you help me for solve this a problem ?
Thank you.

This post has been edited by little_prince41: 25 April 2015 - 08:00 PM

Is This A Good Question/Topic? 0
  • +

Replies To: How to get serial number harddisk in WinCE ?

#2 IronRazer   User is offline

  • Custom Control Freak
  • member icon

Reputation: 1533
  • View blog
  • Posts: 3,860
  • Joined: 01-February 13

Re: How to get serial number harddisk in WinCE ?

Posted 26 April 2015 - 06:55 AM

I am not familiar at all with Win CE but, from what i have read Win CE does not support using WMI so, the only other option that i know of for getting a hard drive serial number is by using some Api functions.

You can try using the DeviceIoControl and CreateFile Api functions. I don`t have any examples made for using them in VB.Net but you can read through the links below to get a handle on what and how the different parameters are used for these functions.

DeviceIoControl (Windows CE 5.0)
DeviceIoControl function
CreateFile (Windows CE 5.0)
CreateFile function


Here are the Win CE VB.Net Api signatures for the 2 functions listed on Pinvoke.Net.

deviceiocontrol (coredll)
CreateFile (coredll)


Here is a link to a CodeProject project that you can download to look through and see how they get the serial number. It is in C++ and i did not download it but, i believe it may be a class library dll that you can probably just add a reference to and use in your VB.Net project.

Get Physical HDD Serial Number without WMI
Was This Post Helpful? 0
  • +
  • -

#3 IronRazer   User is offline

  • Custom Control Freak
  • member icon

Reputation: 1533
  • View blog
  • Posts: 3,860
  • Joined: 01-February 13

Re: How to get serial number harddisk in WinCE ?

Posted 26 April 2015 - 11:13 AM

After doing a little more searching i found the link below where Dave Cluderay has posted an example in VB.Net code that will get the HDD Serial Number using these functions.

He shows the code for the Class and and example code of how you can use it. I think you might be able to use it by just changing the "kernel32.dll" in the Api function signatures to "coredll.dll". Look for his 2nd post with the cleaned up code.

The question was for getting the serial number on a 64bit machine but, it works on my 32bit machine so, hopefully it works for you.

Get HDD (and NOT Volume) Serial Number on Vista Ultimate 64 bit

This post has been edited by IronRazer: 26 April 2015 - 11:13 AM

Was This Post Helpful? 1
  • +
  • -

#4 little_prince41   User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 163
  • Joined: 10-August 07

Re: How to get serial number harddisk in WinCE ?

Posted 27 April 2015 - 05:06 AM

Thanks IronRazer for your advise. :clap:
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1