Skip to content

Commit 29f486b

Browse files
committed
fix formatting
-remove comments -fix header
1 parent 0d8110e commit 29f486b

File tree

2 files changed

+21
-100
lines changed

2 files changed

+21
-100
lines changed

Release/tests/Functional/streams/CppSparseFile.cpp

Lines changed: 1 addition & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/****************************** Module Header ******************************\
22
* Module Name: CppSparseFile.cpp
33
* Project: CppSparseFile
4+
* URL: http://code.msdn.microsoft.com/windowsapps/CppSparseFile-7f28156b
45
* Copyright (c) Microsoft Corporation.
56
*
67
* CppSparseFile demonstrates the common operations on sparse files. A sparse
@@ -238,83 +239,3 @@ BOOL GetSparseRanges(LPCTSTR lpFileName)
238239
CloseHandle(hFile);
239240
return TRUE;
240241
}
241-
//
242-
//
243-
//int _tmain(int argc, _TCHAR* argv[])
244-
//{
245-
// /////////////////////////////////////////////////////////////////////////
246-
// // Determine if the volume support sparse streams.
247-
// //
248-
//
249-
// if (!VolumeSupportsSparseFiles(L"C:\\"))
250-
// {
251-
// wprintf(L"Volume %s does not support sparse streams\n", L"C:\\");
252-
// return 1;
253-
// }
254-
//
255-
//
256-
// /////////////////////////////////////////////////////////////////////////
257-
// // Create a sparse file.
258-
// //
259-
//
260-
// LPCWSTR lpFileName = L"SparseFile.tmp";
261-
// wprintf(L"Create sparse file: %s\n", lpFileName);
262-
//
263-
// HANDLE hSparseFile = CreateSparseFile(lpFileName);
264-
// if (hSparseFile == INVALID_HANDLE_VALUE)
265-
// {
266-
// wprintf(L"CreateFile failed w/err 0x%08lx\n", GetLastError());
267-
// return 1;
268-
// }
269-
//
270-
// // Write a large block of data
271-
//
272-
// const DWORD dwBlockLength = 512 * 1024; // 512KB
273-
// BYTE* lpBlock = new BYTE[dwBlockLength];
274-
// for (DWORD i = 0; i < dwBlockLength; i++)
275-
// {
276-
// lpBlock[i] = 0xFF;
277-
// }
278-
// DWORD dwBytesWritten;
279-
// WriteFile(hSparseFile, lpBlock, dwBlockLength, &dwBytesWritten, NULL);
280-
// delete[] lpBlock;
281-
//
282-
// // Set some sparse ranges in the block
283-
//
284-
// SetSparseRange(hSparseFile, 0, 64 * 1024 /*64KB*/);
285-
// SetSparseRange(hSparseFile, 128 * 1024, 128 * 1024);
286-
//
287-
// // Set sparse block at the end of the file
288-
//
289-
// // 1GB sparse zeros are extended to the end of the file
290-
// SetFilePointer(hSparseFile, 0x40000000 /*1GB*/, NULL, FILE_END);
291-
// SetEndOfFile(hSparseFile);
292-
//
293-
// // Flush and close the file
294-
// CloseHandle(hSparseFile);
295-
//
296-
//
297-
// /////////////////////////////////////////////////////////////////////////
298-
// // Determine if a file is sparse.
299-
// //
300-
//
301-
// BOOL fIsSparse = IsSparseFile(lpFileName);
302-
// wprintf(L"The file is%s sparse\n", fIsSparse ? L"" : L" not");
303-
//
304-
//
305-
// /////////////////////////////////////////////////////////////////////////
306-
// // Get file size.
307-
// //
308-
//
309-
// GetSparseFileSize(lpFileName);
310-
//
311-
//
312-
// /////////////////////////////////////////////////////////////////////////
313-
// // Query the sparse file layout.
314-
// //
315-
//
316-
// GetSparseRanges(lpFileName);
317-
//
318-
//
319-
// return 0;
320-
//}

Release/tests/Functional/streams/CppSparseFile.h

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
/****************************** Module Header ******************************\
2-
* Module Name: CppSparseFile.cpp
3-
* Project: CppSparseFile
4-
* Copyright (c) Microsoft Corporation.
1+
/***
2+
* ==++==
53
*
6-
* CppSparseFile demonstrates the common operations on sparse files. A sparse
7-
* file is a type of computer file that attempts to use file system space more
8-
* efficiently when blocks allocated to the file are mostly empty. This is
9-
* achieved by writing brief information (metadata) representing the empty
10-
* blocks to disk instead of the actual "empty" space which makes up the
11-
* block, using less disk space. You can find in this example the creation of
12-
* sparse file, the detection of sparse attribute, the retrieval of sparse
13-
* file size, and the query of sparse file layout.
4+
* Copyright (c) Microsoft Corporation. All rights reserved.
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
* http://www.apache.org/licenses/LICENSE-2.0
149
*
15-
* This source is subject to the Microsoft Public License.
16-
* See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL.
17-
* All other rights reserved.
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
1815
*
19-
* THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
20-
* EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
21-
* WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
22-
\***************************************************************************/
16+
* ==--==
17+
* =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
18+
*
19+
* CppSparseFile.h : defines various apis for creation and access of sparse files under windows
20+
*
21+
* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
22+
****/
2323

2424
#pragma region Includes
2525
#include <stdio.h>
@@ -93,4 +93,4 @@ void SetSparseRange(HANDLE hSparseFile, LONGLONG start, LONGLONG size);
9393
* \param lpFileName
9494
* File name
9595
*/
96-
BOOL GetSparseRanges(LPCTSTR lpFileName);
96+
BOOL GetSparseRanges(LPCTSTR lpFileName);

0 commit comments

Comments
 (0)