Many Windows development environments can (and do) interface to a version control system through the SCC API interface. The OLE Automation interface, though perhaps better designed, is not in even remotely as wide use.
Since I tend to do most of my work on Windows, I have an interest in integrating CVS with Windows development tools. Not so much for myself as I'm pretty comfortable with the command line (spent a lot of time with Unix :-), however some of my compatriots would like something friendlier.
So after a brief and nearly fruitless attempt to reverse engineer the SCC API I signed the Microsoft NDA and received the official documentation. This introduced a constraint with which I was not comfortable:
Sources containing materials covered by the Microsoft NDA are not freely distributable.That's the bad news. The good news is that you probably don't care.
To make it possible to freely distribute as much as possible of this project, I have split the implementation into two parts.
What remains to be done is to write a nice GUI for CVS.
CVSSCC uses COM to interface with the GUI. This is configurable so that anyonecan write a CVS GUI and tie into the SCC API through CVSSCC. I have written example "coworkers" to show how the COM interface is implemented. I have even added the "coworker" interface into WinCVS - but only the interface, it is not connected to actual CVS functions within WinCVS.
Unfortunately the documentation for the API is not publicly available. You can get the documentationof the interface from Microsoft, by signing a non-disclosure. The SCC API appears to be oriented more toward an RCS/SCCS/SourceSafe style interface - individual file check-in, check-out locked/unlocked, etc. Mapping CVS to this interface in any sort of intelligent manner should be interesting.
Products believed able to usethe SCC API:
Microsoft Visual Studio 6.0 apparently still uses the SCC API rather than using the "official" OLE automation interface. In fact Visual SourceSafe 5.0 implements both the OLE Automation interface and the SCC API. Lucky for us :-).
[HKEY_LOCAL_MACHINE\SOFTWARE\SourceCodeControlProvider] "ProviderRegKey"="Software\\Microsoft\\SourceSafe"The value under ProviderRegKeyis the subkey that tells us what DLL to load:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SourceSafe] "SCCServerName"="Microsoft Visual SourceSafe" "SCCServerPath"="D:\\Program Files\\DevStudio\\Vss\\win32\\ssscc.dll"Microsoft Visual SourceSafe makes the following registry entries:
[HKEY_LOCAL_MACHINE\SOFTWARE\SourceCodeControlProvider] "ProviderRegKey"="Software\\Microsoft\\SourceSafe" [HKEY_LOCAL_MACHINE\SOFTWARE\SourceCodeControlProvider\InstalledSCCProviders] "Microsoft Visual SourceSafe"="Software\\Microsoft\\SourceSafe" [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SourceSafe] "SCCServerName"="Microsoft Visual SourceSafe" "SCCServerPath"="D:\\Program Files\\DevStudio\\Vss\\win32\\ssscc.dll" [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SourceSafe\Databases] "DevStudio"="D:\\Program Files\\DevStudio\\Vss"Starbase Versions makes the following registry entries:
[HKEY_LOCAL_MACHINE\SOFTWARE\SourceCodeControlProvider] "ProviderRegKey"="Software\\StarBase\\MSIntegration" [HKEY_LOCAL_MACHINE\SOFTWARE\SourceCodeControlProvider\InstalledSCCProviders] "StarBase Versions"="Software\\StarBase\\MSIntegration" [HKEY_LOCAL_MACHINE\SOFTWARE\StarBase] [HKEY_LOCAL_MACHINE\SOFTWARE\StarBase\MSIntegration] "SCCServerName"="StarBase Versions" "SCCServerPath"="C:\\WINNT\\System32\\MsSccIntegrationV.dll" [HKEY_LOCAL_MACHINE\SOFTWARE\StarBase\Versions] [HKEY_LOCAL_MACHINE\SOFTWARE\StarBase\Versions\2.0] "Registered User"="Preston L. Bannister" "Registered Company"="." "Registered Serial Number"="33-001-200-123456" "Path"="d:\\Program Files\\Versions\\Versions.exe"Executing the example cvsscc.regwill make the registry entries:
[HKEY_LOCAL_MACHINE\SOFTWARE\SourceCodeControlProvider] "ProviderRegKey"="Software\\CVS\\CVS" [HKEY_LOCAL_MACHINE\SOFTWARE\SourceCodeControlProvider\InstalledSCCProviders] "Concurrent Versions System"="Software\\CVS\\CVS" [HKEY_LOCAL_MACHINE\SOFTWARE\CVS] [HKEY_LOCAL_MACHINE\SOFTWARE\CVS\CVS] "SCCServerName"="Concurrent Versions System" "SCCServerPath"="d:\\cyclic\\cvsscc\\dbin\\cvsscc.dll"
Both Microsoft Visual SourceSafe (ssscc.dll) and Starbase Versions (MsSccIntegrationV.dll) export exactly this set of functions (neither more nor less).
SccAdd SccAddFromScc SccCheckin SccCheckout SccCloseProject SccDiff SccGet SccGetCommandOptions SccGetEvents SccGetProjPath SccGetVersion SccHistory SccInitialize SccOpenProject SccPopulateList SccProperties SccQueryInfo SccRemove SccRename SccRunScc SccSetOption SccUncheckout SccUninitialize
For example, if you compile sccspy.dllwith:
static char* g_sLibraryFilename = "D:\\Program Files\\DevStudio\\Vss\\win32\\ssscc.dll" // SourceSafe // "C:\\WINNT\\System32\\MsSccIntegrationV.dll" // Starbase Versions // "E:\\Cyclic\\ccvs\\dbin\\cvsscc.dll" // CVS ;You will also want to run sccspy.reg to make sccspy.dll the current SCC provider. You might want to rename the ProviderRegKey value first (though you can recreate the value easily enough). As I switch between sccspy, cvsscc, SourceSafe and Starbase Versions, my registry looks like:
[HKEY_LOCAL_MACHINE\SOFTWARE\SourceCodeControlProvider] "cvs.ProviderRegKey"="Software\\ZotSoftware\\CVS" "starbase.ProviderRegKey"="Software\\StarBase\\MSIntegration" "ProviderRegKey"="Software\\ZotSoftware\\SccSpy" "ss.ProviderRegKey"="Software\\Microsoft\\SourceSafe" [HKEY_LOCAL_MACHINE\SOFTWARE\SourceCodeControlProvider\InstalledSCCProviders] "StarBase Versions"="Software\\StarBase\\MSIntegration" "Concurrent Versions System"="Software\\ZotSoftware\\CVS" "Microsoft Visual SourceSafe"="Software\\Microsoft\\SourceSafe" "SCC API Spy"="Software\\ZotSoftware\\SccSpy"Only the ProviderRegKeyvalue is looked at by (for example) MSVC to find the source code provider.
When you call an SCC API entry point on sccspy.dll:
> SccGetVersion GetProcAddress(SccGetVersion) returned 481e0b70 SccGetVersion returns 65537 < SccGetVersion > SccInitialize pSccHandle : 0x12fd64 sCaller : "fakecmd" GetProcAddress(SccInitialize) returned 481e0b80 SccInitialize returns 0 *pSccHandle : 0xbe07e8 sSccName : "SourceSafe" *pSccFeatures 57a0beff USE_OUTPROC HAS_QueryInfo HAS_GetProjPath HAS_AddFromScc +57a0387f sSccPath : "SourceSafe Database" *pnCommentLengthCheckout : 63 *pnCommentLengthGeneral : 4095 < SccInitialize > SccUninitialize h : 0xbe07e8 GetProcAddress(SccUninitialize) returned 481e0c40 SccUninitialize returns 0 < SccUninitialize
| 000000000001.xxx | bit 1 is set |
| 000000000010.xxx | bit 2 is set |
| 000000000011.xxx | bits 1 and 2 are set |
The following is an Perl script for creating the magic files. Adding
the files to your IDE's project is a (tedious) manual operation.
@b4 = (
"0000",
"0001",
"0010",
"0011",
"0100",
"0101",
"0110",
"0111",
"1000",
"1001",
"1010",
"1011",
"1100",
"1101",
"1110",
"1111"
);
@b1 = ("0","1");
foreach $s1 (@b1) {
foreach $s2 (@b4) {
foreach $s3 (@b4) {
foreach $s4 (@b4) {
open FILE, ">>$s1$s2$s3$s4.zzz"
or die "\nCannot create file!\n";
close FILE;
}
}
print "$s1$s2========.zzz\n";
}
}
|
The current point of contact (as of July 2000) is:
Visual Source Safe MSSCCI [msscci@microsoft.com]I have not tried this path, so I can't verify this.
If for any reason the e-mail contact does not work, you may have to revert to the old instructions for going through Microsoft Support. Going through Microsoft Support is a lot less efficient. I was successful in getting routed (eventually) to the right place when I called on 7/21/99, but not without going through a couple humans who were relatively clueless on this subject.
Please try following these instructions before contacting me. I can guarantee you that dozens of people (those that I know of) have successfully obtained the SCC API documentation by following the instructions here.
Drop me a message if the above instructions don't work for you. Or even if they dowork (I'd like to know...:).
| 1998/07/16 | Created. |
| 1998/07/18 | Added sccspy.dll and notes about how to use.
Documented SCC API actually used by Microsoft SourceSafe and Starbase Versions (both are the same). |
| 1998/07/19 | Posted puzzle #1 (MSDEV stumbles after call the SccQueryInfo). |
| 1998/07/28 | Verified parameters to SccInitialize, SccOpenProject and
SccQueryInfo appear correct.
Tested with both SourceSafe and Starbase Versions. |
| 1998/08/05 | Signed Microsoft NDA to get copy of SCC API documentation.
This means I cannot release source for SCC provider implementation that talks directly to SCC API (not my preference!). Unfortunately I will have little time to put into this at least through the end of the year. |
| 1998/11/06 | Solved puzzle #1 (strncpy is not a good idea if
size of destination not known, API is not __stdcall).
Tested skeleton implementations of most SCC entry points. |
| 1998/11/09 | Implemented SccQueryInfo and SccPopulateList (local operation
only - reads CVS/Entries and checks file modified time).
MSVC FileView in IDE will now show which files are known to CVS and which are modified. Context menus offer checkout only for missing files, and offer checkin and undo checkout only for modified files. (Still doesn't do anything with CVS). |
| 1999/01/17 | I have not had time to spend on this project lately, and probably will not again have time for at least a month. Roughly 1-2 mails a month come in from people who would like to use CVS/SCC, but so far no one else has time to work on this either. It will get done, but no promises as to when. |
| 1999/03/20 | Updated information on how to contact Microsoft to obtain the NDA and the SCC API documentation. |
| 1999/03/24 | Updated downloadable files. Fixed a bug in SccOpenProject() and changed the logging behavior to be less confusing (see readme.txt ) in the distribution for more details. Updated contact information for the Microsoft NDA . |
| 1999/04/17 | Started on COM interface for CVSSCC coworker. Added checklist to this page. Started final countdown :). |
| 1999/04/18 | Finished documentation of COM interface for CVSSCC coworker. Have buildable example implementation of COM interface. Added hack to allow testing use of file status bits via "magic" file extension. |
| 1999/05/02 | Working version of CVS_Coworker (an example implementation of the CvsCoworker COM interface) posted. Code was written a week ago, but didn't work as COM wanted either a proxy DLL or the use of only OLE Automation compatible types. Not that the error returned by COM gave any real clue to this... |
| 1999/05/05 | Build 10: Updated CVS_Coworker to do more detailed logging by default in the debug version. Fixed (in CVS_Coworker.cpp) a Microsoft bug that caused the command line build of CVS_Coworker to hang. Added VERSIONINFO resources generated by do/build.pl to accurately track binaries and source code controlled build numbers. Bundled coworker sources along with the cvsscc sources. |
| 1999/05/06 | Build 16: Worked on the build script do/build.pl (which is why so many builds). More concise and detailed logging of status on refresh. Minor puzzle: Why doesn't MSVC ask for a refresh after modifying a file? Have to request a manual refresh to get icons in file view updated. |
| 1999/05/07 | Build 19: Fixed bug in recycled strings in coworker on project re-open. Fixed bug in FindProject when more than one active project. (Thanks to Derek Baum [derek.baum@sbil.co.uk]). |
| 1999/05/11 | Build 21: CVS_Coworker.exe now presents a messagebox when either registered or unregistered, so you can tell if it worked. This is only in the debug version, and will be removed once a "real" installation program is used. In addition cvsscc.dll will present a messagebox if connecting to the coworker fails (presumably because the coworker is not registered). |
| 1999/05/24 | Build 23: Renamed original example coworker from CVS_Coworker to CVS_Coworker0. Created CVS_Coworker1 based on MFC rather than a minimal ATL skeleton. Interestingly enough, an MFC application when invoked via COM does not present a visible window. This is actually the behavior I wanted, but it is not yet clear how to make the window visible. Time to do some more reading... |
| 1999/06/30 | Removed Michelle Khoury as Microsoft contact for NDA information (at her request). |
| 1999/07/22 | Removed Scott Regan as the contact for NDA information (at his request). Apparently he is getting a number of messages on unrelated subjects that are consuming his time, and are better answered by Microsoft Support. This is an abuse of his time. Going through Microsoft Support is less efficient, but will have to do. |
| 1999/07/25 | Build 27: Added logging to the initial DLL registration. If for some reason "regsvr32 cvsscc.dll" fails, then inspect cvsscc.log for clues (or just send it to me :). |
| 1999/08/04 | Build 28: Removed an error from the "coworker" COM interface (one string argument was declared as [in] instead of [in,string] ). Added modified version of WinCVS 1.1b6 to downloads. Removed ccvs.zip (limited webspace) to make room for wincvs.zip file. |
| 1999/08/06 | Build 30: Updated the readme.txt file to be up-front about the incomplete implementation. Added GetFilesToAddBufferLength() to the COM interface and getFilesToAddBufferLength() to CvsProject class. Still need to integrate the CVSSCC and WinCVS builds (if possible as the NDA is a problem). |
| 2000/02/06 | Added "change of tactics" and pulled downloadables. |
| 2000/07/27 | Updated contact information for obtaining SCC API from Microsoft. |
| 2001/05/19 | Posted new tactics and ZotezCVS first iteration. |
| $$ | home |