1// Licensed to the .NET Foundation under one or more agreements.
2// The .NET Foundation licenses this file to you under the MIT license.
3// See the LICENSE file in the project root for more information.
4
5/*============================================================
6**
7** Source: test2.h
8**
9
10**
11**===========================================================*/
12
13
14const char *szChildFileA = "paltest_createprocessa_test2_child";
15const char *szArgs = " A B C";
16const char *szArg1 = "A";
17const char *szArg2 = "B";
18const char *szArg3 = "C";
19
20const char *szPathDelimA = "\\";
21
22const char *szTestString = "Copyright (c) Microsoft";
23
24const DWORD EXIT_OK_CODE = 100;
25const DWORD EXIT_ERR_CODE1 = 101;
26const DWORD EXIT_ERR_CODE2 = 102;
27const DWORD EXIT_ERR_CODE3 = 103;
28const DWORD EXIT_ERR_CODE4 = 104;
29const DWORD EXIT_ERR_CODE5 = 105;
30
31#define BUF_LEN 64
32
33/*
34 * Take two wide strings representing file and directory names
35 * (dirName, fileName), join the strings with the appropriate path
36 * delimiter and populate a wide character buffer (absPathName) with
37 * the resulting string.
38 *
39 * Returns: The number of wide characters in the resulting string.
40 * 0 is returned on Error.
41 */
42int
43mkAbsoluteFilenameA (
44 LPSTR dirName,
45 DWORD dwDirLength,
46 LPCSTR fileName,
47 DWORD dwFileLength,
48 LPSTR absPathName )
49{
50 extern const char *szPathDelimA;
51
52 DWORD sizeDN;
53 DWORD sizeFN;
54 DWORD sizeAPN;
55
56 sizeDN = strlen( dirName );
57 sizeFN = strlen( fileName );
58 sizeAPN = (sizeDN + 1 + sizeFN + 1);
59
60 /* insure ((dirName + DELIM + fileName + \0) =< _MAX_PATH ) */
61 if ( sizeAPN > _MAX_PATH )
62 {
63 return ( 0 );
64 }
65
66 strncpy(absPathName, dirName, dwDirLength +1);
67 strcat(absPathName, szPathDelimA);
68 strcat(absPathName, fileName);
69
70 return (sizeAPN);
71
72}
73