Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 118255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T03:27:57+00:00 2026-05-11T03:27:57+00:00

This is a strange one… In a windows forms app (VB.NET/VS 2005) I have

  • 0

This is a strange one… In a windows forms app (VB.NET/VS 2005) I have the need to occasionally check if the application DVD is inserted.
In my production machine (and in the majority of our clients) this code takes less than an second to execute. But in some machines, it takes about 8 to 10 seconds. I couldn’t find any common ground on those few pcs in which it was slower (different OS, different RAM,different processors, more drives, less drives, etc).
It happens on about 4% of our test machines (and a few of our friends machines, by now:) )
Since this funcion it is only called once, I can live with it. But the strange thing, and we stumbled upon this on pure luck, is that if a VMWare Virtual Machine is running, the code (running in the host OS ) will take the expected less than a second!!!
Has anyone ever encountered anything similar to this? Can anyone at least offer some explanation for this?

i_DrivesArray = GetLogicalDrives()     i_DrivesCount = i_DrivesArray.Length       For i_DriveNumber = 0 To i_DrivesCount - 1         i_DriveInformation = New DriveInfo(i_DrivesArray(i_DriveNumber))          If (i_DriveInformation.DriveType = i_DriveTargetType And i_DriveInformation.IsReady = True) Then              If File.Exists(i_DriveInformation.Name.ToString & ci_CDIdentifiers(i_Counter).ToString) = True Then                 ci_IsCDInserted = True                 ci_PathCD = i_DriveInformation.Name.ToString                 Exit For             End If          End If     Next 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T03:27:57+00:00Added an answer on May 11, 2026 at 3:27 am

    Where’s the cost in this code? Profiling would really help on a bad machine

    I’d imagine the cost is somewhere in those DriveInfo calls – looking in reflector at the code behind DriveInfo:

    .cctor seems pretty innocuous – just validates letter constraints.

    .GetDriveType calls straight down into the equivalent Win32 API. Suspect this will try access the directory root since one of it’s potential return results is DRIVE_NO_ROOT_DIR.

    http://msdn.microsoft.com/en-us/library/aa364939.aspx

    .IsReady – that appears to attempt ‘open’ the drive root directory populate the FILE_ATTRIBUTE structure. Again that looks similar to GetDriveType – possibly expensive.

    Both the latter API’s have the potential to try and touch the drive filesystem. From there on down you’re dependent on the behaviour of the device and it’s drivers for the volume as to what ‘unmounted’, ‘ready, ‘not ready’ etc. means. e.g. trying to spin up a disk.

    Since the delays are in the order of seconds I equally suspect that enumeration of the slow floppy/dvd/cd volumes is what takes the most time compared to other media types. Floppies especially used to have very long timeouts.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 90k
  • Answers 90k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer <i:imageComponent width="480" height="320" imageUrls="img1Url1, imgUrl2" imageCaptions="imageCaption1, imageCaptions2"/> This design is… May 11, 2026 at 6:08 pm
  • Editorial Team
    Editorial Team added an answer See Privileges::Drop. May 11, 2026 at 6:08 pm
  • Editorial Team
    Editorial Team added an answer It looks like some sort of encryption / obfuscation. Without… May 11, 2026 at 6:08 pm

Related Questions

This is a strange one to me. Let me list the setup: Application with
This is a strange one... In a windows forms app (VB.NET/VS 2005) I have
This is a bit of a strange one, but I've been struggling for a
This one seems to be quite ridiculous but how can I open a VS
One of our customers wants to be able to enter a date with only

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.