Click here to Skip to main content
15,889,808 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralMessage Closed Pin
28-May-21 7:20
Member 1496877128-May-21 7:20 
GeneralRe: How to find include directive path? Pin
Richard MacCutchan28-May-21 21:04
mveRichard MacCutchan28-May-21 21:04 
Questionc+ + coding Pin
javaid musa24-May-21 18:17
javaid musa24-May-21 18:17 
AnswerRe: c+ + coding Pin
CPallini24-May-21 20:00
mveCPallini24-May-21 20:00 
QuestionOptimizing this code ? Pin
Duc Axenn24-May-21 0:56
Duc Axenn24-May-21 0:56 
SuggestionRe: Optimizing this code ? Pin
Richard MacCutchan24-May-21 0:02
mveRichard MacCutchan24-May-21 0:02 
GeneralRe: Optimizing this code ? Pin
Duc Axenn24-May-21 0:56
Duc Axenn24-May-21 0:56 
SuggestionRe: Optimizing this code ? Pin
Randor 24-May-21 2:30
professional Randor 24-May-21 2:30 
Duc Axenn wrote:
I just want to verify with the community if there is no problem
The code is technically wrong. But don't worry... it's probably correct 99.99% of the time. Smile | :)

Did you write this code? The top half seems to be written by someone who knows that the file can span across multiple physical disks. The bottom half is incorrectly returning the STORAGE_BUS_TYPE of only the last disk extent.

Microsoft Windows supports spanned volumes[^] which means that in very rare cases a single file might be located on multiple physical disks. Those physical drives could be a mixture of SCSI, SATA, USB, ATAPI, NVME, etcetera...

To make your code more correct you would need to loop through all of those disk extents and return all of the storage bus types[^].

Best Wishes,
-David Delaune

edit: fixed typo

modified 24-May-21 9:06am.

GeneralRe: Optimizing this code ? Pin
Duc Axenn24-May-21 4:21
Duc Axenn24-May-21 4:21 
GeneralRe: Optimizing this code ? Pin
Duc Axenn24-May-21 8:36
Duc Axenn24-May-21 8:36 
GeneralRe: Optimizing this code ? Pin
Randor 24-May-21 14:30
professional Randor 24-May-21 14:30 
GeneralRe: Optimizing this code ? Pin
Duc Axenn24-May-21 20:41
Duc Axenn24-May-21 20:41 
GeneralRe: Optimizing this code ? Pin
Randor 25-May-21 12:25
professional Randor 25-May-21 12:25 
GeneralRe: Optimizing this code ? Pin
Duc Axenn26-May-21 2:53
Duc Axenn26-May-21 2:53 
QuestionCloud Storage Pin
Bram van Kampen23-May-21 15:10
Bram van Kampen23-May-21 15:10 
AnswerRe: Cloud Storage Pin
Victor Nijegorodov23-May-21 22:06
Victor Nijegorodov23-May-21 22:06 
GeneralRe: Cloud Storage Pin
Bram van Kampen29-May-21 14:49
Bram van Kampen29-May-21 14:49 
AnswerRe: Cloud Storage Pin
Gerry Schmitz24-May-21 7:14
mveGerry Schmitz24-May-21 7:14 
GeneralRe: Cloud Storage Pin
Bram van Kampen29-May-21 14:56
Bram van Kampen29-May-21 14:56 
AnswerRe: Cloud Storage Pin
Maximilien25-May-21 2:58
Maximilien25-May-21 2:58 
GeneralRe: Cloud Storage Pin
Bram van Kampen10-Jun-21 14:00
Bram van Kampen10-Jun-21 14:00 
Question32 and 64 bit versions of the same project Pin
Richard Andrew x6415-May-21 16:36
professionalRichard Andrew x6415-May-21 16:36 
JokeRe: 32 and 64 bit versions of the same project Pin
Peter_in_278015-May-21 17:00
professionalPeter_in_278015-May-21 17:00 
GeneralRe: 32 and 64 bit versions of the same project Pin
Member 1520359919-May-21 5:05
Member 1520359919-May-21 5:05 
AnswerRe: 32 and 64 bit versions of the same project Pin
Dave Kreskowiak15-May-21 18:10
mveDave Kreskowiak15-May-21 18:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.