Skip to content
Permalink
Browse files
set svn:eol-style=native for **.cpp
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1442 8ced0084-cf51-0410-be5f-012b33b47a6e
  • Loading branch information
bushing committed Dec 8, 2008
1 parent 901fe7c commit 49cfded60bb5b444d1828190eacc52bbb49a9cb8
Showing with 53,968 additions and 53,968 deletions.
  1. +279 −279 Source/Core/Common/Src/ABI.cpp
  2. +200 −200 Source/Core/Common/Src/CPUDetect.cpp
  3. +22 −22 Source/Core/Common/Src/ChunkFile.cpp
  4. +113 −113 Source/Core/Common/Src/Common.cpp
  5. +57 −57 Source/Core/Common/Src/DriveUtil.cpp
  6. +151 −151 Source/Core/Common/Src/DynamicLibrary.cpp
  7. +437 −437 Source/Core/Common/Src/ExtendedTrace.cpp
  8. +119 −119 Source/Core/Common/Src/FileSearch.cpp
  9. +496 −496 Source/Core/Common/Src/FileUtil.cpp
  10. +136 −136 Source/Core/Common/Src/Hash.cpp
  11. +469 −469 Source/Core/Common/Src/IniFile.cpp
  12. +233 −233 Source/Core/Common/Src/MappedFile.cpp
  13. +44 −44 Source/Core/Common/Src/MathUtil.cpp
  14. +144 −144 Source/Core/Common/Src/MemArena.cpp
  15. +135 −135 Source/Core/Common/Src/MemoryUtil.cpp
  16. +100 −100 Source/Core/Common/Src/Plugin.cpp
  17. +396 −396 Source/Core/Common/Src/StringUtil.cpp
  18. +38 −38 Source/Core/Common/Src/TestFramework.cpp
  19. +404 −404 Source/Core/Common/Src/Thread.cpp
  20. +153 −153 Source/Core/Common/Src/Thunk.cpp
  21. +99 −99 Source/Core/Common/Src/Timer.cpp
  22. +123 −123 Source/Core/Common/Src/WaveFile.cpp
  23. +18 −18 Source/Core/Common/Src/stdafx.cpp
  24. +232 −232 Source/Core/Common/Src/x64Analyzer.cpp
  25. +1,499 −1,499 Source/Core/Common/Src/x64Emitter.cpp
  26. +511 −511 Source/Core/Core/Src/ARDecrypt.cpp
  27. +985 −985 Source/Core/Core/Src/ActionReplay.cpp
  28. +298 −298 Source/Core/Core/Src/Boot/Boot.cpp
  29. +400 −400 Source/Core/Core/Src/Boot/Boot_BIOSEmu.cpp
  30. +80 −80 Source/Core/Core/Src/Boot/Boot_DOL.cpp
  31. +71 −71 Source/Core/Core/Src/Boot/Boot_ELF.cpp
  32. +258 −258 Source/Core/Core/Src/Boot/ElfReader.cpp
  33. +160 −160 Source/Core/Core/Src/Console.cpp
  34. +593 −593 Source/Core/Core/Src/Core.cpp
  35. +160 −160 Source/Core/Core/Src/CoreParameter.cpp
  36. +377 −377 Source/Core/Core/Src/CoreTiming.cpp
  37. +195 −195 Source/Core/Core/Src/Debugger/Debugger_BreakPoints.cpp
  38. +157 −157 Source/Core/Core/Src/Debugger/Debugger_SymbolMap.cpp
  39. +87 −87 Source/Core/Core/Src/Debugger/Dump.cpp
  40. +150 −150 Source/Core/Core/Src/Debugger/PPCDebugInterface.cpp
  41. +141 −141 Source/Core/Core/Src/HLE/HLE.cpp
  42. +161 −161 Source/Core/Core/Src/HLE/HLE_Misc.cpp
  43. +148 −148 Source/Core/Core/Src/HLE/HLE_OS.cpp
  44. +361 −361 Source/Core/Core/Src/HW/AudioInterface.cpp
  45. +237 −237 Source/Core/Core/Src/HW/CPU.cpp
  46. +246 −246 Source/Core/Core/Src/HW/CPUCompare.cpp
  47. +728 −728 Source/Core/Core/Src/HW/CommandProcessor.cpp
  48. +669 −669 Source/Core/Core/Src/HW/DSP.cpp
  49. +599 −599 Source/Core/Core/Src/HW/DVDInterface.cpp
  50. +116 −116 Source/Core/Core/Src/HW/EXI.cpp
  51. +284 −284 Source/Core/Core/Src/HW/EXI_Channel.cpp
  52. +164 −164 Source/Core/Core/Src/HW/EXI_Device.cpp
  53. +92 −92 Source/Core/Core/Src/HW/EXI_DeviceAD16.cpp
  54. +282 −282 Source/Core/Core/Src/HW/EXI_DeviceIPL.cpp
  55. +387 −387 Source/Core/Core/Src/HW/EXI_DeviceMemoryCard.cpp
  56. +147 −147 Source/Core/Core/Src/HW/GPFifo.cpp
  57. +107 −107 Source/Core/Core/Src/HW/HW.cpp
  58. +1,347 −1,347 Source/Core/Core/Src/HW/Memmap.cpp
  59. +95 −95 Source/Core/Core/Src/HW/MemoryInterface.cpp
  60. +232 −232 Source/Core/Core/Src/HW/PeripheralInterface.cpp
  61. +219 −219 Source/Core/Core/Src/HW/PixelEngine.cpp
  62. +557 −557 Source/Core/Core/Src/HW/SerialInterface.cpp
  63. +238 −238 Source/Core/Core/Src/HW/SerialInterface_Devices.cpp
  64. +61 −61 Source/Core/Core/Src/HW/StreamADPCM.cpp
  65. +234 −234 Source/Core/Core/Src/HW/SystemTimers.cpp
  66. +562 −562 Source/Core/Core/Src/HW/VideoInterface.cpp
  67. +134 −134 Source/Core/Core/Src/HW/WII_IOB.cpp
  68. +262 −262 Source/Core/Core/Src/HW/WII_IPC.cpp
  69. +2 −2 Source/Core/Core/Src/Host.cpp
  70. +480 −480 Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp
  71. +272 −272 Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_DI.cpp
  72. +246 −246 Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp
  73. +499 −499 Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_fs.cpp
  74. +170 −170 Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net.cpp
  75. +158 −158 Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_sdio_slot0.cpp
  76. +1,856 −1,856 Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp
  77. +970 −970 Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_WiiMote.cpp
  78. +271 −271 Source/Core/Core/Src/IPC_HLE/WiiMote_HID_Attr.cpp
  79. +368 −368 Source/Core/Core/Src/LogManager.cpp
  80. +220 −220 Source/Core/Core/Src/MemTools.cpp
  81. +175 −175 Source/Core/Core/Src/PatchEngine.cpp
  82. +129 −129 Source/Core/Core/Src/Plugins/Plugin_DSP.cpp
  83. +162 −162 Source/Core/Core/Src/Plugins/Plugin_DVD.cpp
  84. +83 −83 Source/Core/Core/Src/Plugins/Plugin_PAD.cpp
  85. +143 −143 Source/Core/Core/Src/Plugins/Plugin_Video.cpp
  86. +105 −105 Source/Core/Core/Src/Plugins/Plugin_Wiimote.cpp
  87. +166 −166 Source/Core/Core/Src/PowerPC/Interpreter/Interpreter.cpp
  88. +143 −143 Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_Branch.cpp
  89. +537 −537 Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_FloatingPoint.cpp
  90. +585 −585 Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_Integer.cpp
  91. +656 −656 Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_LoadStore.cpp
  92. +341 −341 Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_LoadStorePaired.cpp
  93. +261 −261 Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_Paired.cpp
  94. +516 −516 Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_SystemRegisters.cpp
  95. +420 −420 Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp
  96. +374 −374 Source/Core/Core/Src/PowerPC/Jit64/JitAsm.cpp
  97. +197 −197 Source/Core/Core/Src/PowerPC/Jit64/JitBackpatch.cpp
  98. +429 −429 Source/Core/Core/Src/PowerPC/Jit64/JitCache.cpp
  99. +59 −59 Source/Core/Core/Src/PowerPC/Jit64/JitCore.cpp
  100. +397 −397 Source/Core/Core/Src/PowerPC/Jit64/JitRegCache.cpp
  101. +262 −262 Source/Core/Core/Src/PowerPC/Jit64/Jit_Branch.cpp
  102. +234 −234 Source/Core/Core/Src/PowerPC/Jit64/Jit_FloatingPoint.cpp
  103. +1,018 −1,018 Source/Core/Core/Src/PowerPC/Jit64/Jit_Integer.cpp
  104. +465 −465 Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStore.cpp
  105. +303 −303 Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStoreFloating.cpp
  106. +465 −465 Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStorePaired.cpp
  107. +451 −451 Source/Core/Core/Src/PowerPC/Jit64/Jit_Paired.cpp
  108. +194 −194 Source/Core/Core/Src/PowerPC/Jit64/Jit_SystemRegisters.cpp
  109. +145 −145 Source/Core/Core/Src/PowerPC/Jit64/Jit_Util.cpp
  110. +765 −765 Source/Core/Core/Src/PowerPC/PPCAnalyst.cpp
  111. +733 −733 Source/Core/Core/Src/PowerPC/PPCTables.cpp
  112. +294 −294 Source/Core/Core/Src/PowerPC/PowerPC.cpp
  113. +93 −93 Source/Core/Core/Src/PowerPC/Profiler.cpp
  114. +211 −211 Source/Core/Core/Src/PowerPC/SignatureDB.cpp
  115. +383 −383 Source/Core/Core/Src/PowerPC/SymbolDB.cpp
  116. +233 −233 Source/Core/Core/Src/State.cpp
  117. +147 −147 Source/Core/Core/Src/Tracer.cpp
  118. +91 −91 Source/Core/Core/Src/VolumeHandler.cpp
  119. +17 −17 Source/Core/Core/Src/stdafx.cpp
  120. +88 −88 Source/Core/DebuggerWX/Src/BreakPointDlg.cpp
  121. +121 −121 Source/Core/DebuggerWX/Src/BreakpointView.cpp
  122. +376 −376 Source/Core/DebuggerWX/Src/BreakpointWindow.cpp
  123. +561 −561 Source/Core/DebuggerWX/Src/CodeView.cpp
  124. +1,234 −1,234 Source/Core/DebuggerWX/Src/CodeWindow.cpp
  125. +19 −19 Source/Core/DebuggerWX/Src/Debugger.cpp
  126. +211 −211 Source/Core/DebuggerWX/Src/JitWindow.cpp
  127. +519 −519 Source/Core/DebuggerWX/Src/LogWindow.cpp
  128. +112 −112 Source/Core/DebuggerWX/Src/MemoryCheckDlg.cpp
  129. +430 −430 Source/Core/DebuggerWX/Src/MemoryView.cpp
  130. +221 −221 Source/Core/DebuggerWX/Src/MemoryWindow.cpp
  131. +158 −158 Source/Core/DebuggerWX/Src/RegisterView.cpp
  132. +97 −97 Source/Core/DebuggerWX/Src/RegisterWindow.cpp
  133. +103 −103 Source/Core/DiscIO/Src/BannerLoader.cpp
  134. +193 −193 Source/Core/DiscIO/Src/BannerLoaderGC.cpp
  135. +224 −224 Source/Core/DiscIO/Src/BannerLoaderWii.cpp
  136. +110 −110 Source/Core/DiscIO/Src/Blob.cpp
  137. +342 −342 Source/Core/DiscIO/Src/CompressedBlob.cpp
  138. +25 −25 Source/Core/DiscIO/Src/DriveBlob.cpp
  139. +110 −110 Source/Core/DiscIO/Src/FileBlob.cpp
  140. +237 −237 Source/Core/DiscIO/Src/FileHandlerARC.cpp
  141. +249 −249 Source/Core/DiscIO/Src/FileSystemGCWii.cpp
  142. +50 −50 Source/Core/DiscIO/Src/Filesystem.cpp
  143. +262 −262 Source/Core/DiscIO/Src/VolumeCreator.cpp
  144. +466 −466 Source/Core/DiscIO/Src/VolumeDirectory.cpp
  145. +169 −169 Source/Core/DiscIO/Src/VolumeGC.cpp
  146. +254 −254 Source/Core/DiscIO/Src/VolumeWiiCrypted.cpp
  147. +21 −21 Source/Core/DiscIO/Src/stdafx.cpp
  148. +93 −93 Source/Core/DolphinWX/Src/AboutDolphin.cpp
  149. +181 −181 Source/Core/DolphinWX/Src/BootManager.cpp
  150. +178 −178 Source/Core/DolphinWX/Src/CheatsWindow.cpp
  151. +137 −137 Source/Core/DolphinWX/Src/Config.cpp
  152. +539 −539 Source/Core/DolphinWX/Src/ConfigMain.cpp
  153. +726 −726 Source/Core/DolphinWX/Src/Frame.cpp
  154. +806 −806 Source/Core/DolphinWX/Src/GameListCtrl.cpp
  155. +18 −18 Source/Core/DolphinWX/Src/Globals.cpp
  156. +172 −172 Source/Core/DolphinWX/Src/ISOFile.cpp
  157. +775 −775 Source/Core/DolphinWX/Src/ISOProperties.cpp
  158. +395 −395 Source/Core/DolphinWX/Src/Main.cpp
  159. +742 −742 Source/Core/DolphinWX/Src/MemcardManager.cpp
  160. +1,002 −1,002 Source/Core/DolphinWX/Src/MemoryCards/GCMemcard.cpp
  161. +109 −109 Source/Core/DolphinWX/Src/PatchAddEdit.cpp
  162. +192 −192 Source/Core/DolphinWX/Src/PluginManager.cpp
  163. +23 −23 Source/Core/VideoCommon/Src/BPMemory.cpp
  164. +29 −29 Source/Core/VideoCommon/Src/CPMemory.cpp
  165. +167 −167 Source/Core/VideoCommon/Src/Fifo.cpp
  166. +45 −45 Source/Core/VideoCommon/Src/LookUpTables.cpp
  167. +846 −846 Source/Core/VideoCommon/Src/PixelShader.cpp
  168. +291 −291 Source/Core/VideoCommon/Src/Profiler.cpp
  169. +43 −43 Source/Core/VideoCommon/Src/Statistics.cpp
  170. +1,380 −1,380 Source/Core/VideoCommon/Src/TextureDecoder.cpp
  171. +466 −466 Source/Core/VideoCommon/Src/VertexShader.cpp
  172. +51 −51 Source/Core/VideoCommon/Src/VideoState.cpp
  173. +131 −131 Source/Core/VideoCommon/Src/XFBConvert.cpp
  174. +22 −22 Source/Core/VideoCommon/Src/XFMemory.cpp
  175. +53 −53 Source/TestSuite/Audio/Test1/source/Test1.cpp
  176. +56 −56 Source/TestSuite/Misc/Aram/source/Aram.cpp
  177. +55 −55 Source/TestSuite/SI/Test1/source/Test1.cpp

Large diffs are not rendered by default.

Large diffs are not rendered by default.

@@ -1,22 +1,22 @@
// Copyright (C) 2003-2008 Dolphin Project.

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.

// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/

// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/

#include "Common.h"
#include "ChunkFile.h"

#include <stdio.h>

// Copyright (C) 2003-2008 Dolphin Project.

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.

// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/

// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/

#include "Common.h"
#include "ChunkFile.h"

#include <stdio.h>

@@ -1,113 +1,113 @@
// Copyright (C) 2003-2008 Dolphin Project.

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.

// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/

// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/

#include <stdio.h>

#include "Common.h"
#include "StringUtil.h"

namespace
{
static PanicAlertHandler panic_handler = 0;
}

void RegisterPanicAlertHandler(PanicAlertHandler handler)
{
panic_handler = handler;
}


void PanicAlert(const char* format, ...)
{
va_list args;
va_start(args, format);

if (panic_handler)
{
std::string msg;
StringFromFormatV(&msg, format, args);
LOG(MASTER_LOG, "PANIC: %s", msg.c_str());
panic_handler(msg.c_str(), false);
}
else
{
#ifdef _WIN32
std::string msg;
StringFromFormatV(&msg, format, args);
LOG(MASTER_LOG, "PANIC: %s", msg.c_str());
MessageBox(0, msg.c_str(), "PANIC!", MB_ICONWARNING);
#elif __GNUC__
//#error Do a messagebox!
vprintf(format, args);
printf("\n");
// asm ("int $3") ;
#endif
}

va_end(args);
}


bool PanicYesNo(const char* format, ...)
{
va_list args;
va_start(args, format);
bool retval;
#ifdef _WIN32
std::string msg;
StringFromFormatV(&msg, format, args);
LOG(MASTER_LOG, "PANIC: %s", msg.c_str());
retval = IDYES == MessageBox(0, msg.c_str(), "PANIC! Continue?", MB_ICONQUESTION | MB_YESNO);
#elif __GNUC__
//vprintf(format, args);
return(true); //#error Do a messagebox!
#endif

va_end(args);
return(retval);
}


bool AskYesNo(const char* format, ...)
{
va_list args;
va_start(args, format);
bool retval;
#ifdef _WIN32
std::string msg;
StringFromFormatV(&msg, format, args);
LOG(MASTER_LOG, "ASK: %s", msg.c_str());
retval = IDYES == MessageBox(0, msg.c_str(), "Dolphin", MB_ICONQUESTION | MB_YESNO);
#elif __GNUC__
//vprintf(format, args);
return(true); //#error Do a messagebox!
#endif

va_end(args);
return(retval);
}

// Standard implementation of logging - simply print to standard output.
// Programs are welcome to override this.
/*
void __Log(int logNumber, const char *text, ...)
{
va_list args;
va_start(args, text);
vprintf(text, args);
va_end(args);
}*/
// Copyright (C) 2003-2008 Dolphin Project.

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.

// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/

// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/

#include <stdio.h>

#include "Common.h"
#include "StringUtil.h"

namespace
{
static PanicAlertHandler panic_handler = 0;
}

void RegisterPanicAlertHandler(PanicAlertHandler handler)
{
panic_handler = handler;
}


void PanicAlert(const char* format, ...)
{
va_list args;
va_start(args, format);

if (panic_handler)
{
std::string msg;
StringFromFormatV(&msg, format, args);
LOG(MASTER_LOG, "PANIC: %s", msg.c_str());
panic_handler(msg.c_str(), false);
}
else
{
#ifdef _WIN32
std::string msg;
StringFromFormatV(&msg, format, args);
LOG(MASTER_LOG, "PANIC: %s", msg.c_str());
MessageBox(0, msg.c_str(), "PANIC!", MB_ICONWARNING);
#elif __GNUC__
//#error Do a messagebox!
vprintf(format, args);
printf("\n");
// asm ("int $3") ;
#endif
}

va_end(args);
}


bool PanicYesNo(const char* format, ...)
{
va_list args;
va_start(args, format);
bool retval;
#ifdef _WIN32
std::string msg;
StringFromFormatV(&msg, format, args);
LOG(MASTER_LOG, "PANIC: %s", msg.c_str());
retval = IDYES == MessageBox(0, msg.c_str(), "PANIC! Continue?", MB_ICONQUESTION | MB_YESNO);
#elif __GNUC__
//vprintf(format, args);
return(true); //#error Do a messagebox!
#endif

va_end(args);
return(retval);
}


bool AskYesNo(const char* format, ...)
{
va_list args;
va_start(args, format);
bool retval;
#ifdef _WIN32
std::string msg;
StringFromFormatV(&msg, format, args);
LOG(MASTER_LOG, "ASK: %s", msg.c_str());
retval = IDYES == MessageBox(0, msg.c_str(), "Dolphin", MB_ICONQUESTION | MB_YESNO);
#elif __GNUC__
//vprintf(format, args);
return(true); //#error Do a messagebox!
#endif

va_end(args);
return(retval);
}

// Standard implementation of logging - simply print to standard output.
// Programs are welcome to override this.
/*
void __Log(int logNumber, const char *text, ...)
{
va_list args;
va_start(args, text);
vprintf(text, args);
va_end(args);
}*/
@@ -1,57 +1,57 @@
// Copyright (C) 2003-2008 Dolphin Project.

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.

// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/

// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/

#include "Common.h"

#ifdef _WIN32
#include <windows.h>
#include <winioctl.h>
#endif

void GetAllRemovableDrives(std::vector<std::string> *drives) {
drives->clear();
#ifdef _WIN32
HANDLE hDisk;
DISK_GEOMETRY diskGeometry;

for (int i = 'A'; i < 'Z'; i++)
{
char path[MAX_PATH];
sprintf(path, "\\\\.\\%c:", i);
hDisk = CreateFile(path, 0, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
if (hDisk != INVALID_HANDLE_VALUE)
{
DWORD dwBytes;
DeviceIoControl(hDisk, IOCTL_DISK_GET_DRIVE_GEOMETRY, NULL, 0, &diskGeometry, sizeof(DISK_GEOMETRY), &dwBytes, NULL);
// Only proceed if disk is a removable media
if (diskGeometry.MediaType == RemovableMedia)
{
if (diskGeometry.BytesPerSector == 2048) {
// Probably CD/DVD drive.
// "Remove" the "\\.\" part of the path and return it.
drives->push_back(path + 4);
}
}
}
CloseHandle(hDisk);
}
#else
// TODO
// stat("/media/cdrom") or whatever etc etc
#endif
}

// Copyright (C) 2003-2008 Dolphin Project.

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.

// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/

// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/

#include "Common.h"

#ifdef _WIN32
#include <windows.h>
#include <winioctl.h>
#endif

void GetAllRemovableDrives(std::vector<std::string> *drives) {
drives->clear();
#ifdef _WIN32
HANDLE hDisk;
DISK_GEOMETRY diskGeometry;

for (int i = 'A'; i < 'Z'; i++)
{
char path[MAX_PATH];
sprintf(path, "\\\\.\\%c:", i);
hDisk = CreateFile(path, 0, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
if (hDisk != INVALID_HANDLE_VALUE)
{
DWORD dwBytes;
DeviceIoControl(hDisk, IOCTL_DISK_GET_DRIVE_GEOMETRY, NULL, 0, &diskGeometry, sizeof(DISK_GEOMETRY), &dwBytes, NULL);
// Only proceed if disk is a removable media
if (diskGeometry.MediaType == RemovableMedia)
{
if (diskGeometry.BytesPerSector == 2048) {
// Probably CD/DVD drive.
// "Remove" the "\\.\" part of the path and return it.
drives->push_back(path + 4);
}
}
}
CloseHandle(hDisk);
}
#else
// TODO
// stat("/media/cdrom") or whatever etc etc
#endif
}

0 comments on commit 49cfded

Please sign in to comment.