Updated original files with working VS projects

This commit is contained in:
soradotwav
2024-06-14 10:09:43 -07:00
parent e73b1047c0
commit 66181fe039
26 changed files with 2967 additions and 2715 deletions
-5
View File
@@ -1,11 +1,6 @@
# SQLVDI
This folder contains the latest files and samples required to build a SQL Server VDI based backup/restore application.
### Files available
1. vdi.h
2. vdierror.h
3. vdiguid.h
A new **VDC_Complete** command was added to SQLVDI that indicates SQL Server has completed sending data to the VDI client. Therefore, the VDI client will be able to finish the backup before it sends response to SQL Server.
More details about this improvement in the SQLVDI protocol can be found in [KB3188454: Enhance VDI Protocol with VDC_Complete command in SQL Server] (https://support.microsoft.com/en-us/kb/3188454)
File diff suppressed because it is too large Load Diff
@@ -1,100 +0,0 @@
# Microsoft Developer Studio Project File - Name="mprocess" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=mprocess - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "mprocess.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "mprocess.mak" CFG="mprocess - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "mprocess - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "mprocess - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "mprocess - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "mprocess - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "mprocess - Win32 Release"
# Name "mprocess - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\mprocess.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project
@@ -1,29 +0,0 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "mprocess"=.\mprocess.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################
@@ -0,0 +1,141 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{fe97585b-08bd-4837-a5ba-5c960e591f29}</ProjectGuid>
<RootNamespace>mprocess</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>..\include</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="mprocess.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\include\vdi.h" />
<ClInclude Include="..\include\vdierror.h" />
<ClInclude Include="..\include\vdiguid.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="mprocess.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\include\vdi.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\vdierror.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\vdiguid.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>
+421 -413
View File
@@ -39,185 +39,188 @@ All Rights Reserved.
#include "vdierror.h" // error constants
#include "vdiguid.h" // define the GUIDs
void LogError (
LPSTR location, // must always be provided
LPSTR description, // NULL is acceptable
DWORD errCode); // windows status code
void LogError(
const char* location, // must always be provided
const char* description, // NULL is acceptable
DWORD errCode); // windows status code
int performTransfer (
IClientVirtualDevice* vd,
int backup,
int streamId);
int performTransfer(
IClientVirtualDevice* vd,
int backup,
int streamId);
HANDLE execSQL (int doBackup, int nStreams);
HANDLE execSQL(bool doBackup, int nStreams);
int
startSecondaries(
IClientVirtualDeviceSet *vds,
HANDLE hSQLProcess, // handle to process dealing with the SQL
int nStreams); // number of i/o streams
int startSecondaries(
IClientVirtualDeviceSet2* vds,
HANDLE hSQLProcess, // handle to process dealing with the SQL
int nStreams); // number of i/o streams
unsigned __stdcall
runSecondary (void *parms);
runSecondary(void* parms);
// Using a GUID for the VDS Name is a good way to assure uniqueness.
//
WCHAR wVdsName [50];
WCHAR wVdsName[50];
//
// main function
//
int main(int argc, char *argv[])
int main(int argc, char* argv[])
{
HRESULT hr;
IClientVirtualDeviceSet* vds = NULL ;
VDConfig config;
int badParm=TRUE;
int doBackup;
HANDLE hProcess;
int termCode = -1;
int nStreams=1;
HRESULT hr;
IClientVirtualDeviceSet2* vds = nullptr;
VDConfig config;
bool badParm = true;
bool doBackup;
HANDLE hProcess;
int termCode = -1;
int nStreams = 1;
// Check the input parm
//
if (argc == 3)
{
sscanf (argv[2], "%d", &nStreams);
switch (toupper(argv[1][0]))
{
case 'B':
doBackup = TRUE;
badParm = FALSE;
break;
case 'R':
doBackup = FALSE;
badParm = FALSE;
break;
}
}
// Check the input parm
//
if (argc == 3)
{
sscanf_s(argv[2], "%d", &nStreams);
if (badParm)
{
printf ("useage: mprocess {B|R} <nStreams>\n"
"Demonstrate a multistream Backup or Restore using the Virtual Device Interface\n");
exit (1);
}
switch (toupper(argv[1][0]))
{
case 'B':
doBackup = true;
badParm = false;
break;
// 1..32 streams.
//
if (nStreams < 1)
nStreams = 1;
else if (nStreams > 32)
nStreams = 32;
case 'R':
doBackup = false;
badParm = false;
break;
}
}
printf ("Performing a %s using %d virtual device(s).\n",
(doBackup) ? "BACKUP" : "RESTORE", nStreams);
if (badParm)
{
printf("usage: mthread {B|R} <nStreams>\n"
"Demonstrate a multistream Backup or Restore using the Virtual Device Interface\n");
exit(1);
}
// Initialize COM Library
// Note: _WIN32_DCOM must be defined during the compile.
//
hr = CoInitializeEx (NULL, COINIT_MULTITHREADED);
// 1..32 streams.
//
if (nStreams < 1)
nStreams = 1;
else if (nStreams > 32)
nStreams = 32;
if (!SUCCEEDED (hr))
{
printf ("Coinit fails: x%X\n", hr);
exit (1);
}
printf("Performing a %s using %d virtual device(s).\n",
(doBackup) ? "BACKUP" : "RESTORE", nStreams);
// Initialize COM Library
// Note: _WIN32_DCOM must be defined during the compile.
//
hr = CoInitializeEx(nullptr, COINIT_MULTITHREADED);
if (FAILED(hr))
{
printf("Coinit fails: x%X\n", hr);
exit(1);
}
// Get an interface to the device set.
// Notice how we use a single IID for both the class and interface
// identifiers.
//
hr = CoCreateInstance (
IID_IClientVirtualDeviceSet,
NULL,
CLSCTX_INPROC_SERVER,
IID_IClientVirtualDeviceSet,
(void**)&vds);
// Get an interface to the device set.
// Notice how we use a single IID for both the class and interface
// identifiers.
//
hr = CoCreateInstance(
CLSID_MSSQL_ClientVirtualDeviceSet,
nullptr,
CLSCTX_INPROC_SERVER,
IID_IClientVirtualDeviceSet2,
(void**)&vds);
if (!SUCCEEDED (hr))
{
// This failure might happen if the DLL was not registered.
//
printf ("Could not create component: x%X\n", hr);
printf ("Check registration of SQLVDI.DLL and value of IID\n");
goto exit;
}
if (FAILED(hr))
{
// This failure might happen if the DLL was not registered.
//
printf("Could not create component: x%X\n", hr);
printf("Check registration of SQLVDI.DLL and value of IID\n");
goto exit;
}
// Setup the VDI configuration we want to use.
// This program doesn't use any fancy features, so the
// only field to setup is the deviceCount.
//
// The server will treat the virtual device just like a pipe:
// I/O will be strictly sequential with only the basic commands.
//
memset(&config, 0, sizeof(config));
config.deviceCount = nStreams;
// Create a GUID to use for a unique virtual device name
//
GUID vdsId;
CoCreateGuid (&vdsId);
StringFromGUID2 (vdsId, wVdsName, 49);
CoCreateGuid(&vdsId);
StringFromGUID2(vdsId, wVdsName, 49);
// Setup the VDI configuration we want to use.
// This program doesn't use any fancy features, so the
// only field to setup is the deviceCount.
//
// The server will treat the virtual device just like a pipe:
// I/O will be strictly sequential with only the basic commands.
//
memset (&config, 0, sizeof(config));
// Create the virtual device set
// for use by the default instance.
//
// To use a named instance, change the
// first parameter in CreateEx to your instance's name.
//
hr = vds->CreateEx(nullptr, wVdsName, &config);
if (FAILED(hr))
{
printf("VDS::Create fails: x%X", hr);
goto exit;
}
config.deviceCount = nStreams;
// Send the SQL command, via isql in a subprocess.
//
printf("\nSending the SQL...\n");
// Create the virtual device set
//
hr = vds->Create (wVdsName, &config);
if (!SUCCEEDED (hr))
{
printf ("VDS::Create fails: x%X", hr);
goto exit;
}
// Send the SQL command, via isql in a subprocess.
//
printf("\nSending the SQL...\n");
hProcess = execSQL (doBackup, nStreams);
if (hProcess == NULL)
{
printf ("execSQL failed.\n");
goto shutdown;
}
hProcess = execSQL(doBackup, nStreams);
if (hProcess == nullptr)
{
printf("execSQL failed.\n");
goto shutdown;
}
// Wait for the server to connect, completing the configuration.
// Notice that we wait a maximum of 15 seconds.
//
printf("\nWaiting for SQL to complete configuration...\n");
// Wait for the server to connect, completing the configuration.
// Notice that we wait a maximum of 15 seconds.
//
printf("\nWaiting for SQL to complete configuration...\n");
hr = vds->GetConfiguration (15000, &config);
if (!SUCCEEDED (hr))
{
printf ("VDS::Getconfig fails: x%X\n", hr);
goto shutdown;
}
hr = vds->GetConfiguration(15000, &config);
if (FAILED(hr))
{
printf("VDS::Getconfig fails: x%X\n", hr);
goto shutdown;
}
// Handle the virtual devices in secondary processes.
//
printf("\nSpawning secondary threads..\n");
termCode = startSecondaries(vds, hProcess, nStreams);
// Handle the virtual devices in secondary processes.
//
printf ("\nSpawning secondary threads..\n");
termCode = startSecondaries (vds, hProcess, nStreams);
shutdown:
// Close the set
//
vds->Close ();
// Close the set
//
vds->Close();
// COM reference counting: Release the interface.
//
vds->Release () ;
// COM reference counting: Release the interface.
//
vds->Release();
exit:
// Uninitialize COM Library
//
CoUninitialize () ;
// Uninitialize COM Library
//
CoUninitialize();
return termCode;
return termCode;
}
//
@@ -227,47 +230,50 @@ exit:
// NULL : failed to start isql
// else : process handle
//
HANDLE execSQL (int doBackup, int nStreams)
HANDLE execSQL(bool doBackup, int nStreams)
{
char cmd[5000];
char extend[100];
PROCESS_INFORMATION pi;
STARTUPINFO si;
int ix;
WCHAR cmd[5000];
WCHAR extend[100];
PROCESS_INFORMATION pi;
STARTUPINFO si;
int ix;
sprintf (cmd, "osql -E -b -Q\"%s DATABASE PUBS %s VIRTUAL_DEVICE='%ls'",
(doBackup) ? "BACKUP" : "RESTORE",
(doBackup) ? "TO" : "FROM",
// To use a named instance, change "-S ." to "-S .\\instance_name"
swprintf_s(cmd, L"osql -S . -E -b -Q\"%s DATABASE PUBS %s VIRTUAL_DEVICE='%ls'",
(doBackup) ? L"BACKUP" : L"RESTORE",
(doBackup) ? L"TO" : L"FROM",
wVdsName);
for (ix=1; ix<nStreams; ix++)
{
sprintf (extend, ", VIRTUAL_DEVICE='%ls%d'", wVdsName, ix);
strcat (cmd, extend);
}
strcat (cmd, "\"");
for (ix = 1; ix < nStreams; ix++)
{
swprintf_s(extend, L", VIRTUAL_DEVICE='%ls%d'", wVdsName, ix);
wcscat_s(cmd, extend);
}
printf ("Submitting SQL:\n%s\n\n", cmd);
wcscat_s(cmd, L"\"");
// use my process for startup info
//
GetStartupInfo (&si);
wprintf(L"Submitting SQL:\n%s\n\n", cmd);
if (!CreateProcess (NULL, cmd, NULL, NULL,
TRUE, // inherit handles (stdin/stdout)
0, // creation flags,
NULL, NULL,
&si, // startup info
&pi)) // out: process info
{
LogError ("startSecondary", "CreateProcess", GetLastError ());
return NULL;
}
// Return the process handle
//
return (pi.hProcess);
// use my process for startup info
//
GetStartupInfo(&si);
if (!CreateProcess(nullptr, cmd, nullptr, nullptr,
true, // inherit handles (stdin/stdout)
0, // creation flags,
nullptr, nullptr,
&si, // startup info
&pi)) // out: process info
{
LogError("startSecondary", "CreateProcess", GetLastError());
return nullptr;
}
CloseHandle(pi.hThread);
// Return the process handle
//
return (pi.hProcess);
}
//-----------------------------------------------------------
@@ -275,8 +281,8 @@ HANDLE execSQL (int doBackup, int nStreams)
// A parmameter block to use when spawning secondaries.
//
struct THREAD_PARMS {
IClientVirtualDeviceSet *vds;
int streamId;
IClientVirtualDeviceSet* vds;
int streamId;
};
@@ -289,107 +295,109 @@ struct THREAD_PARMS {
//
int
startSecondaries(
IClientVirtualDeviceSet *vds,
HANDLE hSQLProcess, // handle to process dealing with the SQL
int nStreams) // number of i/o streams
IClientVirtualDeviceSet2* vds,
HANDLE hSQLProcess, // handle to process dealing with the SQL
int nStreams // number of i/o streams
)
{
THREAD_PARMS parms[32]; // each thread needs its own parm block
int ix,nActive;
HANDLE children[33]; // 32 is maximum number of streams.
// plus one for the isql process.
DWORD waitStatus, exitCode;
unsigned threadId;
THREAD_PARMS parms[32]; // each thread needs its own parm block
int ix, nActive;
HANDLE children[33]; // 32 is maximum number of streams.
for (ix=0; ix<nStreams; ix++)
{
// All threads share the same virtual device set,
// but must operate on different virtual devices.
//
parms[ix].vds = vds;
parms[ix].streamId = ix;
// plus one for the isql process.
DWORD waitStatus, exitCode;
unsigned threadId;
children[ix] = (HANDLE)_beginthreadex (
NULL, 0, runSecondary, (void*)&parms[ix], 0, &threadId);
for (ix = 0; ix < nStreams; ix++)
{
// All threads share the same virtual device set,
// but must operate on different virtual devices.
//
parms[ix].vds = vds;
parms[ix].streamId = ix;
if (children[ix] == NULL)
{
printf ("Failed to create thread. errno is %d\n", errno);
goto errorExit;
}
children[ix] = (HANDLE)_beginthreadex(
nullptr, 0, runSecondary, (void*)&parms[ix], 0, &threadId);
printf ("\nStarted thread %d\n", threadId);
}
if (children[ix] == nullptr)
{
printf("Failed to create thread. errno is %d\n", errno);
goto errorExit;
}
// Add the isql process into the array
//
children[nStreams] = hSQLProcess;
nActive = nStreams+1;
printf("\nStarted thread %d\n", threadId);
}
// Wait for all to finish.
// Max wait is one minute for this tiny test.
//
printf ("All children are now running.\n"
"Waiting for their completion...\n");
waitStatus = WaitForMultipleObjects (nActive, children,
TRUE, 60000);
// Add the isql process into the array
//
children[nStreams] = hSQLProcess;
nActive = nStreams + 1;
if (waitStatus < WAIT_OBJECT_0 ||
waitStatus >= WAIT_OBJECT_0+nActive)
{
LogError ("startSecondary", "WaitForMultiple", GetLastError ());
printf("Unexpected wait code: %d\n", waitStatus);
goto errorExit;
}
// Wait for all to finish.
// Max wait is one minute for this tiny test.
//
printf("All children are now running.\n"
"Waiting for their completion...\n");
// All of the children have completed.
// Get the completion code from 'isql' to check for sucess.
//
if (!GetExitCodeProcess (hSQLProcess, &exitCode))
{
LogError ("startSecondary", "GetExitCode", GetLastError ());
goto errorExit;
}
waitStatus = WaitForMultipleObjects(nActive, children,
true, 60000);
if (exitCode != 0)
{
printf ("The SQL operation failed with code %d\n", exitCode);
goto errorExit;
}
if (waitStatus < WAIT_OBJECT_0 ||
waitStatus >= WAIT_OBJECT_0 + nActive)
{
LogError("startSecondary", "WaitForMultiple", GetLastError());
printf("Unexpected wait code: %d\n", waitStatus);
goto errorExit;
}
printf ("The SQL operation was sucessful.\n");
// All of the children have completed.
// Get the completion code from 'isql' to check for sucess.
//
if (!GetExitCodeProcess(hSQLProcess, &exitCode))
{
LogError("startSecondary", "GetExitCode", GetLastError());
goto errorExit;
}
// Be sure to close handles when finished with them.
//
// Notice that in our trivial error handling here we
// don't bother closing them, since handles are
// automatically closed as part of process termination.
//
for (ix = 0; ix < nActive; ix++)
{
CloseHandle (children[ix]);
}
if (exitCode != 0)
{
printf("The SQL operation failed with code %d\n", exitCode);
goto errorExit;
}
return 0;
printf("The SQL operation was sucessful.\n");
// Be sure to close handles when finished with them.
//
// Notice that in our trivial error handling here we
// don't bother closing them, since handles are
// automatically closed as part of process termination.
//
for (ix = 0; ix < nActive; ix++)
{
CloseHandle(children[ix]);
}
return 0;
errorExit:
// Handle all problems in a trivial fashion:
// SignalAbort() will cause all processes using the virtual device set
// to terminate processing.
//
vds->SignalAbort ();
// Handle all problems in a trivial fashion:
// SignalAbort() will cause all processes using the virtual device set
// to terminate processing.
//
vds->SignalAbort();
// However, since the threads are using the virtual device set allocated
// by the main thread, we can't let the main thread close the set before
// the threads are finished with it. There are two options:
// 1) exit the process immediately.
// 2) wait for the threads to terminate.
//
// Option 2 is "cleaner" but requires more code, so we just exit here:
//
ExitProcess ((unsigned)-1);
// However, since the threads are using the virtual device set allocated
// by the main thread, we can't let the main thread close the set before
// the threads are finished with it. There are two options:
// 1) exit the process immediately.
// 2) wait for the threads to terminate.
//
// Option 2 is "cleaner" but requires more code, so we just exit here:
//
ExitProcess((unsigned)-1);
return -1; // ExitProcess doesn't return; this avoids a compiler error.
return -1; // ExitProcess doesn't return; this avoids a compiler error.
}
//------------------------------------------------------------------
@@ -399,71 +407,71 @@ errorExit:
// spawning the thread.
//
unsigned __stdcall
runSecondary (void *parms)
runSecondary(void* parms)
{
HRESULT hr;
WCHAR devName[100];
IClientVirtualDevice* vd;
VDConfig config;
int termCode;
HRESULT hr;
WCHAR devName[100];
IClientVirtualDevice* vd;
VDConfig config;
int termCode;
// Fetch the input parms
//
int streamId = ((THREAD_PARMS*)parms)->streamId;
IClientVirtualDeviceSet * vds = ((THREAD_PARMS*)parms)->vds;
// Fetch the input parms
//
int streamId = ((THREAD_PARMS*)parms)->streamId;
IClientVirtualDeviceSet* vds = ((THREAD_PARMS*)parms)->vds;
// Build the name of the device assigned to this thread.
//
if (streamId == 0)
{
// The first device has the same name as the set.
//
wcscpy (devName, wVdsName);
}
else
{
// For this example, we've simply appended a number
// for additional devices. You are free to name them
// as you wish.
//
swprintf (devName, L"%s%d", wVdsName, streamId);
}
// Build the name of the device assigned to this thread.
//
if (streamId == 0)
{
// The first device has the same name as the set.
//
wcscpy_s(devName, wVdsName);
}
else
{
// For this example, we've simply appended a number
// for additional devices. You are free to name them
// as you wish.
//
swprintf_s(devName, L"%s%d", wVdsName, streamId);
}
// Open the device assigned to this thread.
//
hr = vds->OpenDevice (devName, &vd);
if (!SUCCEEDED (hr))
{
printf ("OpenDevice fails on %ls: x%X", devName, hr);
termCode = -1;
goto errExit;
}
// Open the device assigned to this thread.
//
hr = vds->OpenDevice(devName, &vd);
if (FAILED(hr))
{
wprintf(L"OpenDevice fails on %ls: x%X", devName, hr);
termCode = -1;
goto errExit;
}
// Grab the config to figure out data direction
//
hr = vds->GetConfiguration (INFINITE, &config);
if (!SUCCEEDED (hr))
{
printf ("VDS::Getconfig fails: x%X\n", hr);
termCode = -1;
goto errExit;
}
// Grab the config to figure out data direction
//
hr = vds->GetConfiguration(INFINITE, &config);
if (FAILED(hr))
{
wprintf(L"VDS::Getconfig fails: x%X\n", hr);
termCode = -1;
goto errExit;
}
printf ("\nPerforming data transfer...\n");
termCode = performTransfer (vd,
(config.features&VDF_WriteMedia), streamId);
printf("\nPerforming data transfer...\n");
termCode = performTransfer(vd,
(config.features & VDF_WriteMedia), streamId);
errExit:
// If errors were detected, force an abort.
//
if (termCode != 0)
{
vds->SignalAbort ();
}
// If errors were detected, force an abort.
//
if (termCode != 0)
{
vds->SignalAbort();
}
return ((unsigned)termCode);
return ((unsigned)termCode);
}
@@ -474,95 +482,95 @@ errExit:
//
// Returns 0, if no errors are detected, else non-zero.
//
int performTransfer (
IClientVirtualDevice* vd,
int backup,
int streamId)
int performTransfer(
IClientVirtualDevice* vd,
int backup,
int streamId)
{
FILE * fh;
char fname[80];
VDC_Command * cmd;
DWORD completionCode;
DWORD bytesTransferred;
HRESULT hr;
int termCode = -1;
FILE* fh;
char fname[80];
VDC_Command* cmd;
DWORD completionCode;
DWORD bytesTransferred;
HRESULT hr;
int termCode = -1;
sprintf (fname, "multi.%d.dmp", streamId);
sprintf_s(fname, "multi.%d.dmp", streamId);
fh = fopen (fname, (backup)? "wb" : "rb");
if (fh == NULL )
{
printf ("Failed to open: %s\n", fname);
return -1;
}
errno_t error = fopen_s(&fh, fname, (backup) ? "wb" : "rb");
if (error != 0)
{
printf("Failed to open: %s\n", fname);
return -1;
}
while (SUCCEEDED (hr=vd->GetCommand (INFINITE, &cmd)))
{
bytesTransferred = 0;
switch (cmd->commandCode)
{
case VDC_Read:
bytesTransferred = fread (cmd->buffer, 1, cmd->size, fh);
if (bytesTransferred == cmd->size)
completionCode = ERROR_SUCCESS;
else
// assume failure is eof
completionCode = ERROR_HANDLE_EOF;
while (SUCCEEDED(hr = vd->GetCommand(INFINITE, &cmd)))
{
bytesTransferred = 0;
switch (cmd->commandCode)
{
case VDC_Read:
bytesTransferred = fread(cmd->buffer, 1, cmd->size, fh);
if (bytesTransferred == cmd->size)
completionCode = ERROR_SUCCESS;
else
// assume failure is eof
completionCode = ERROR_HANDLE_EOF;
break;
break;
case VDC_Write:
bytesTransferred = fwrite (cmd->buffer, 1, cmd->size, fh);
if (bytesTransferred == cmd->size )
{
completionCode = ERROR_SUCCESS;
}
else
// assume failure is disk full
completionCode = ERROR_DISK_FULL;
break;
case VDC_Write:
bytesTransferred = fwrite(cmd->buffer, 1, cmd->size, fh);
if (bytesTransferred == cmd->size)
{
completionCode = ERROR_SUCCESS;
}
else
// assume failure is disk full
completionCode = ERROR_DISK_FULL;
break;
case VDC_Flush:
fflush (fh);
completionCode = ERROR_SUCCESS;
break;
case VDC_ClearError:
completionCode = ERROR_SUCCESS;
break;
case VDC_Flush:
fflush(fh);
completionCode = ERROR_SUCCESS;
break;
default:
// If command is unknown...
completionCode = ERROR_NOT_SUPPORTED;
}
case VDC_ClearError:
completionCode = ERROR_SUCCESS;
break;
default:
// If command is unknown...
completionCode = ERROR_NOT_SUPPORTED;
}
hr = vd->CompleteCommand (cmd, completionCode, bytesTransferred, 0);
if (!SUCCEEDED (hr))
{
printf ("Completion Failed: x%X\n", hr);
break;
}
}
hr = vd->CompleteCommand(cmd, completionCode, bytesTransferred, 0);
if (FAILED(hr))
{
printf("Completion Failed: x%X\n", hr);
break;
}
}
if (hr != VD_E_CLOSE)
{
printf ("Unexpected termination: x%X\n", hr);
}
else
{
// As far as the data transfer is concerned, no
// errors occurred. The code which issues the SQL
// must determine if the backup/restore was
// really successful.
//
printf ("Successfully completed data transfer.\n");
termCode = 0;
}
if (hr != VD_E_CLOSE)
{
printf("Unexpected termination: x%X\n", hr);
}
else
{
// As far as the data transfer is concerned, no
// errors occurred. The code which issues the SQL
// must determine if the backup/restore was
// really successful.
//
printf("Successfully completed data transfer.\n");
termCode = 0;
}
fclose (fh);
fclose(fh);
return termCode;
return termCode;
}
@@ -570,31 +578,31 @@ int performTransfer (
//
// A simple error logger.
//
void LogError (
LPSTR location, // must always be provided
LPSTR description, // NULL is acceptable
DWORD errCode) // windows status code
void LogError(
const char* location, // must always be provided
const char* description, // NULL is acceptable
DWORD errCode) // windows status code
{
LPVOID lpMsgBuf;
LPWSTR lpMsgBuf = nullptr;
printf (
"Error at %s: %s StatusCode: %X\n",
location,
(description==NULL)?"":description,
errCode);
printf(
"Error at %s: %s StatusCode: %X\n",
location,
(description == nullptr) ? "" : description,
errCode);
// Attempt to explain the code
//
if (errCode != 0 && FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
errCode,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
(LPTSTR) &lpMsgBuf, 0, NULL ) )// Process any inserts in lpMsgBuf.
{
printf ("Explanation: %s\n", lpMsgBuf);
LocalFree( lpMsgBuf );
}
// Attempt to explain the code
//
if (errCode != 0 && FormatMessageW(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
nullptr,
errCode,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
reinterpret_cast<LPWSTR>(&lpMsgBuf), 0, nullptr)) // Process any inserts in lpMsgBuf.
{
printf("Explanation: %ls\n", lpMsgBuf);
LocalFree(lpMsgBuf);
}
}
-100
View File
@@ -1,100 +0,0 @@
# Microsoft Developer Studio Project File - Name="mthread" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=mthread - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "mthread.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "mthread.mak" CFG="mthread - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "mthread - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "mthread - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "mthread - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "mthread - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "mthread - Win32 Release"
# Name "mthread - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\mthread.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project
@@ -1,29 +0,0 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "mthread"=.\mthread.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################
@@ -0,0 +1,141 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{f4600084-90ad-42b9-9809-ade6e1c06423}</ProjectGuid>
<RootNamespace>mthread</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>..\include</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\include\vdi.h" />
<ClInclude Include="..\include\vdierror.h" />
<ClInclude Include="..\include\vdiguid.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="mthread.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\include\vdi.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\vdierror.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\vdiguid.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="mthread.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>
File diff suppressed because it is too large Load Diff
-100
View File
@@ -1,100 +0,0 @@
# Microsoft Developer Studio Project File - Name="osimple" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=osimple - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "osimple.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "osimple.mak" CFG="osimple - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "osimple - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "osimple - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "osimple - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "osimple - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "osimple - Win32 Release"
# Name "osimple - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\osimple.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project
@@ -1,29 +0,0 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "osimple"=.\osimple.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################
@@ -0,0 +1,142 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{a0d4d328-678f-46d3-8af1-3530d8c55507}</ProjectGuid>
<RootNamespace>osimple</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<EnableASAN>false</EnableASAN>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>..\include</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\include\vdi.h" />
<ClInclude Include="..\include\vdierror.h" />
<ClInclude Include="..\include\vdiguid.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="osimple.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\include\vdi.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\vdierror.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\vdiguid.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="osimple.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>
+238 -239
View File
@@ -37,193 +37,193 @@ All Rights Reserved.
#include "vdierror.h" // error constants
#include "vdiguid.h" // define the interface identifiers.
// IMPORTANT: vdiguid.h can only be included in one source file.
//
// IMPORTANT: vdiguid.h can only be included in one source file.
//
void performTransfer(
IClientVirtualDevice* vd,
bool backup);
void performTransfer (
IClientVirtualDevice* vd,
int backup );
int execSQL (int doBackup);
int execSQL(bool doBackup);
// Using a GUID for the VDS Name is a good way to assure uniqueness.
//
WCHAR wVdsName [50];
WCHAR wVdsName[50];
//
// main function
//
int main(int argc, char *argv[])
int main(int argc, char* argv[])
{
HRESULT hr;
IClientVirtualDeviceSet2* vds = NULL ;
IClientVirtualDevice* vd=NULL;
HRESULT hr;
IClientVirtualDeviceSet2* vds = nullptr;
IClientVirtualDevice* vd = nullptr;
VDConfig config;
int badParm=TRUE;
int doBackup;
int hProcess;
int termCode;
VDConfig config;
bool badParm = true;
bool doBackup;
bool isUnnamed = false;
int hProcess;
int termCode;
// Check the input parm
//
if (argc == 2)
{
if (toupper(argv[1][0]) == 'B')
{
doBackup = TRUE;
badParm = FALSE;
}
else if (toupper(argv[1][0]) == 'R')
{
doBackup = FALSE;
badParm = FALSE;
}
}
// Check the input parm
//
if (argc == 2)
{
char param = toupper(argv[1][0]);
if (badParm)
{
printf ("useage: simple {B|R}\n"
"Demonstrate a Backup or Restore using the Virtual Device Interface\n");
exit (1);
}
if (param == 'B')
{
doBackup = true;
badParm = false;
}
else if (param == 'R')
{
doBackup = false;
badParm = false;
}
}
// Initialize COM Library
// Note: _WIN32_DCOM must be defined during the compile.
//
hr = CoInitializeEx (NULL, COINIT_MULTITHREADED);
if (badParm)
{
printf("usage: simple {B|R}\n"
"Demonstrate a Backup or Restore using the Virtual Device Interface\n");
exit(1);
}
if (!SUCCEEDED (hr))
{
printf ("Coinit fails: x%X\n", hr);
exit (1);
}
// Initialize COM Library
// Note: _WIN32_DCOM must be defined during the compile.
//
hr = CoInitializeEx(nullptr, COINIT_MULTITHREADED);
// Get an interface to the device set.
// Changes from SQLServer v7.0:
// - we've introduced a symbol for the class ID.
// - We've added a new "multi-instance-aware" interface.
//
hr = CoCreateInstance (
CLSID_MSSQL_ClientVirtualDeviceSet,
NULL,
CLSCTX_INPROC_SERVER,
IID_IClientVirtualDeviceSet2,
(void**)&vds);
if (FAILED(hr))
{
printf("Coinit fails: x%X\n", hr);
exit(1);
}
if (!SUCCEEDED (hr))
{
// This failure might happen if the DLL was not registered,
// or if the application is using the wrong interface id (IID).
//
printf ("Could not create component: x%X\n", hr);
printf ("Check registration of SQLVDI.DLL and value of IID\n");
goto exit;
}
// Get an interface to the device set.
hr = CoCreateInstance(
CLSID_MSSQL_ClientVirtualDeviceSet,
nullptr,
CLSCTX_INPROC_SERVER,
IID_IClientVirtualDeviceSet2,
(void**)&vds);
// Setup the VDI configuration we want to use.
// This program doesn't use any fancy features, so the
// only field to setup is the deviceCount.
//
// The server will treat the virtual device just like a pipe:
// I/O will be strictly sequential with only the basic commands.
//
memset (&config, 0, sizeof(config));
config.deviceCount = 1;
if (FAILED(hr))
{
// This failure might happen if the DLL was not registered,
// or if the application is using the wrong interface id (IID).
//
printf("Could not create component: x%X\n", hr);
printf("Check registration of SQLVDI.DLL and value of IID\n");
goto exit;
}
// Setup the VDI configuration we want to use.
// This program doesn't use any fancy features, so the
// only field to setup is the deviceCount.
//
// The server will treat the virtual device just like a pipe:
// I/O will be strictly sequential with only the basic commands.
//
memset(&config, 0, sizeof(config));
config.deviceCount = 1;
// Create a GUID to use for a unique virtual device name
//
GUID vdsId;
CoCreateGuid (&vdsId);
StringFromGUID2 (vdsId, wVdsName, 49);
CoCreateGuid(&vdsId);
StringFromGUID2(vdsId, wVdsName, 49);
// Create the virtual device set
// Create the virtual device set
// for use by the default instance.
// Change the first parameter to identify a named instance.
//
// To use a named instance, change the
// first parameter in CreateEx to your instance's name.
//
hr = vds->CreateEx (NULL, wVdsName, &config);
if (!SUCCEEDED (hr))
{
printf ("VDS::Create fails: x%X", hr);
goto exit;
}
hr = vds->CreateEx(nullptr, wVdsName, &config);
if (FAILED(hr))
{
printf("VDS::Create fails: x%X", hr);
goto exit;
}
// Send the SQL command, by starting 'isql' in a subprocess.
//
printf("\nSending the SQL...\n");
// Send the SQL command, by starting 'isql' in a subprocess.
//
printf("\nSending the SQL...\n");
hProcess = execSQL (doBackup);
if (hProcess == -1)
{
printf ("execSQL failed.\n");
goto shutdown;
}
hProcess = execSQL(doBackup);
if (hProcess == -1)
{
printf("execSQL failed.\n");
goto shutdown;
}
// Wait for the server to connect, completing the configuration.
//
hr = vds->GetConfiguration (10000, &config);
if (!SUCCEEDED (hr))
{
printf ("VDS::Getconfig fails: x%X\n", hr);
if (hr == VD_E_TIMEOUT)
{
printf ("Timed out. Was Microsoft SQLServer running?\n");
}
goto shutdown;
}
// Wait for the server to connect, completing the configuration.
//
hr = vds->GetConfiguration(10000, &config);
if (FAILED(hr))
{
printf("VDS::Getconfig fails: x%X\n", hr);
if (hr == VD_E_TIMEOUT)
{
printf("Timed out. Was Microsoft SQLServer running?\n");
}
goto shutdown;
}
// Open the single device in the set.
//
hr = vds->OpenDevice(wVdsName, &vd);
if (FAILED(hr))
{
printf("VDS::OpenDevice fails: x%X\n", hr);
goto shutdown;
}
printf("\nPerforming data transfer...\n");
performTransfer(vd, doBackup);
// Open the single device in the set.
//
hr = vds->OpenDevice (wVdsName, &vd);
if (!SUCCEEDED(hr))
{
printf ("VDS::OpenDevice fails: x%X\n", hr);
goto shutdown;
}
printf ("\nPerforming data transfer...\n");
performTransfer (vd, doBackup);
shutdown:
// Close the set
//
vds->Close ();
// Close the set
//
vds->Close();
// Obtain the SQL completion information, by waiting for isql to exit.
//
if (hProcess == _cwait( &termCode, hProcess, NULL))
{
if (termCode == 0)
printf("\nThe SQL command executed successfully.\n");
else
printf("\nThe SQL command failed.\n");
}
else
{
printf ("cwait failed: %d\n", errno);
}
// Obtain the SQL completion information, by waiting for isql to exit.
//
if (hProcess == _cwait(&termCode, hProcess, 0))
{
if (termCode == 0)
printf("\nThe SQL command executed successfully.\n");
else
printf("\nThe SQL command failed.\n");
}
else
{
printf("cwait failed: %d\n", errno);
}
// COM reference counting: Release the interface.
//
// Rather than releasing it, the application has the
// option to 'Create' another set, reusing the interface
// that it currently has. Of course that applies to
// a real application, not this simple sample!
//
vds->Release () ;
// COM reference counting: Release the interface.
//
// Rather than releasing it, the application has the
// option to 'Create' another set, reusing the interface
// that it currently has. Of course that applies to
// a real application, not this simple sample!
//
vds->Release();
exit:
// Uninitialize COM Library
//
CoUninitialize () ;
// Uninitialize COM Library
//
CoUninitialize();
return 0 ;
return 0;
}
//
@@ -233,116 +233,115 @@ exit:
// -1 : failed to spawn
// else : a "process handle"
//
int execSQL (int doBackup)
int execSQL(bool doBackup)
{
char sqlCommand [1024]; // plenty of space for our purpose
wchar_t sqlCommand[1024]; // plenty of space for our purpose
sprintf (sqlCommand, "-Q\"%s DATABASE PUBS %s VIRTUAL_DEVICE='%ls'\"",
(doBackup) ? "BACKUP" : "RESTORE",
(doBackup) ? "TO" : "FROM",
// To use a named instance, change "-S ." to "-S .\\instance_name"
swprintf_s(sqlCommand, L"-S . -Q\"%s DATABASE PUBS %s VIRTUAL_DEVICE='%ls'\"",
(doBackup) ? L"BACKUP" : L"RESTORE",
(doBackup) ? L"TO" : L"FROM",
wVdsName);
int rc;
intptr_t rc;
printf ("spawning osql to execute: %s\n", sqlCommand);
wprintf(L"spawning osql to execute: %ls\n", sqlCommand);
// Spawn off the osql utility to execute the SQL.
// Notice the '-b' which causes an error to set a non-zero
// exit code on error.
// Spawn off the osql utility to execute the SQL.
// Notice the '-b' which causes an error to set a non-zero
// exit code on error.
//
rc = _spawnlp( _P_NOWAIT, "osql", "osql", "-E", "-b",
sqlCommand, NULL);
rc = _wspawnlp(_P_NOWAIT, L"osql", L"osql", L"-E", L"-b",
sqlCommand, NULL);
if (rc == -1)
{
printf ("Spawn failed with error: %d\n", errno);
}
return (rc);
if (rc == -1)
{
printf("Spawn failed with error: %d\n", errno);
}
return (rc);
}
// This routine reads commands from the server until a 'Close' status is received.
// It simply reads or writes a file 'superbak.dmp' in the current directory.
//
void performTransfer (
IClientVirtualDevice* vd,
int backup )
void performTransfer(
IClientVirtualDevice* vd,
bool backup)
{
FILE * fh;
char* fname = "superbak.dmp";
VDC_Command * cmd;
DWORD completionCode;
DWORD bytesTransferred;
HRESULT hr;
FILE* fh;
char* fname = (char*)"superbak.dmp";
VDC_Command* cmd;
DWORD completionCode;
DWORD bytesTransferred;
HRESULT hr;
fh = fopen (fname, (backup)? "wb" : "rb");
if (fh == NULL )
{
printf ("Failed to open: %s\n", fname);
return;
}
errno_t error = fopen_s(&fh, fname, (backup) ? "wb" : "rb");
if (error != 0)
{
printf("Failed to open: %s\n", fname);
return;
}
while (SUCCEEDED (hr=vd->GetCommand (INFINITE, &cmd)))
{
bytesTransferred = 0;
switch (cmd->commandCode)
{
case VDC_Read:
bytesTransferred = fread (cmd->buffer, 1, cmd->size, fh);
if (bytesTransferred == cmd->size)
completionCode = ERROR_SUCCESS;
else
// assume failure is eof
completionCode = ERROR_HANDLE_EOF;
break;
while (SUCCEEDED(hr = vd->GetCommand(INFINITE, &cmd)))
{
bytesTransferred = 0;
switch (cmd->commandCode)
{
case VDC_Read:
bytesTransferred = fread(cmd->buffer, 1, cmd->size, fh);
if (bytesTransferred == cmd->size)
completionCode = ERROR_SUCCESS;
else
// assume failure is eof
completionCode = ERROR_HANDLE_EOF;
break;
case VDC_Write:
bytesTransferred = fwrite (cmd->buffer, 1, cmd->size, fh);
if (bytesTransferred == cmd->size )
{
completionCode = ERROR_SUCCESS;
}
else
// assume failure is disk full
completionCode = ERROR_DISK_FULL;
break;
case VDC_Write:
bytesTransferred = fwrite(cmd->buffer, 1, cmd->size, fh);
if (bytesTransferred == cmd->size)
{
completionCode = ERROR_SUCCESS;
}
else
// assume failure is disk full
completionCode = ERROR_DISK_FULL;
break;
case VDC_Flush:
fflush (fh);
completionCode = ERROR_SUCCESS;
break;
case VDC_ClearError:
completionCode = ERROR_SUCCESS;
break;
case VDC_Flush:
fflush(fh);
completionCode = ERROR_SUCCESS;
break;
default:
// If command is unknown...
completionCode = ERROR_NOT_SUPPORTED;
}
case VDC_ClearError:
completionCode = ERROR_SUCCESS;
break;
hr = vd->CompleteCommand (cmd, completionCode, bytesTransferred, 0);
if (!SUCCEEDED (hr))
{
printf ("Completion Failed: x%X\n", hr);
break;
}
}
default:
// If command is unknown...
completionCode = ERROR_NOT_SUPPORTED;
}
if (hr != VD_E_CLOSE)
{
printf ("Unexpected termination: x%X\n", hr);
}
else
{
// As far as the data transfer is concerned, no
// errors occurred. The code which issues the SQL
// must determine if the backup/restore was
// really successful.
//
printf ("Successfully completed data transfer.\n");
}
fclose (fh);
}
hr = vd->CompleteCommand(cmd, completionCode, bytesTransferred, 0);
if (FAILED(hr))
{
printf("Completion Failed: x%X\n", hr);
break;
}
}
if (hr != VD_E_CLOSE)
{
printf("Unexpected termination: x%X\n", hr);
}
else
{
// As far as the data transfer is concerned, no
// errors occurred. The code which issues the SQL
// must determine if the backup/restore was
// really successful.
//
printf("Successfully completed data transfer.\n");
}
fclose(fh);
}
-100
View File
@@ -1,100 +0,0 @@
# Microsoft Developer Studio Project File - Name="simple" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=simple - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "simple.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "simple.mak" CFG="simple - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "simple - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "simple - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "simple - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "simple - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "simple - Win32 Release"
# Name "simple - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\simple.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project
-29
View File
@@ -1,29 +0,0 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "simple"=.\simple.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################
@@ -0,0 +1,141 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{13df2fa4-99d2-44ac-b218-3463730b6f08}</ProjectGuid>
<RootNamespace>simple</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions);</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>..\include</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\..\include\vdi.h" />
<ClInclude Include="..\..\include\vdierror.h" />
<ClInclude Include="..\..\include\vdiguid.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="simple.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\include\vdi.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\vdierror.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\vdiguid.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="simple.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>
File diff suppressed because it is too large Load Diff
@@ -1,100 +0,0 @@
# Microsoft Developer Studio Project File - Name="snapshot" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=snapshot - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "snapshot.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "snapshot.mak" CFG="snapshot - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "snapshot - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "snapshot - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "snapshot - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "snapshot - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "snapshot - Win32 Release"
# Name "snapshot - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\snapshot.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project
@@ -1,29 +0,0 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "snapshot"=.\snapshot.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################
@@ -0,0 +1,142 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{f51dacf4-9aba-4f84-a508-041d3c1f2399}</ProjectGuid>
<RootNamespace>snapshot</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<EnableASAN>false</EnableASAN>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>..\include</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="snapshot.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\include\vdi.h" />
<ClInclude Include="..\include\vdierror.h" />
<ClInclude Include="..\include\vdiguid.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="snapshot.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\include\vdi.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\vdierror.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\vdiguid.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>