Skip to content

Commit

Permalink
Fixed some casing problems
Browse files Browse the repository at this point in the history
  • Loading branch information
ClementDreptin committed Oct 11, 2022
1 parent 90d427a commit 9f0433a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
22 changes: 11 additions & 11 deletions Publisher/src/Utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
// Each bytes is represented as 2 characters in hex and we need an extra character to null-terminate the string
#define HASH_LENGTH ((sizeof(uint32_t) * 2) + 1)

HRESULT BuildXLASTFile(const char *shortcutName)
HRESULT BuildXLastFile(const char *shortcutName)
{
HRESULT hr = S_OK;

Expand Down Expand Up @@ -141,12 +141,12 @@ HRESULT BuildXLASTFile(const char *shortcutName)
return S_OK;
}

HRESULT ExecBLAST()
HRESULT ExecBlast()
{
HRESULT hr = S_OK;

char execDirBuffer[MAX_PATH] = { 0 };
char BLASTParameters[MAX_PATH] = { 0 };
char blastParameters[MAX_PATH] = { 0 };

SHELLEXECUTEINFO shellExecInfo = { 0 };

Expand All @@ -156,16 +156,16 @@ HRESULT ExecBLAST()
return E_FAIL;

// Create the full list of parameters to pass to BLAST
strncpy_s(BLASTParameters, MAX_PATH, execDirBuffer, _TRUNCATE);
strncat_s(BLASTParameters, MAX_PATH, "\\tmp.xlast /build /install:Local /nologo", _TRUNCATE);
strncpy_s(blastParameters, MAX_PATH, execDirBuffer, _TRUNCATE);
strncat_s(blastParameters, MAX_PATH, "\\tmp.xlast /build /install:Local /nologo", _TRUNCATE);

// Populate the SHELLEXECUTEINFO struct
shellExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
shellExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS | SEE_MASK_NOASYNC | SEE_MASK_NO_CONSOLE;
shellExecInfo.hwnd = NULL;
shellExecInfo.lpVerb = NULL;
shellExecInfo.lpFile = "blast.exe";
shellExecInfo.lpParameters = BLASTParameters;
shellExecInfo.lpParameters = blastParameters;
shellExecInfo.lpDirectory = execDirBuffer;
shellExecInfo.nShow = SW_SHOW;
shellExecInfo.hInstApp = NULL;
Expand Down Expand Up @@ -271,7 +271,7 @@ HRESULT GetShortcutName(char *shortcutName, size_t maxLength)
return hr;
}

HRESULT CheckXBDMConnection(void)
HRESULT CheckXbdmConnection(void)
{
HRESULT hr = S_OK;
size_t xboxNameSize = MAX_PATH;
Expand Down Expand Up @@ -422,21 +422,21 @@ void Cleanup(void)
{
HRESULT hr = S_OK;
char pathToOnlineDir[MAX_PATH] = { 0 };
char pathToXLASTFile[MAX_PATH] = { 0 };
char pathToXLastFile[MAX_PATH] = { 0 };

// Read the executable directory path and write it to pathToOnlineDir
hr = GetExecDir(pathToOnlineDir, MAX_PATH);
if (FAILED(hr))
return;

// Copy the executable directory path (which lives in pathToOnlineDir) into pathToXLASTFile
strncpy_s(pathToXLASTFile, MAX_PATH, pathToOnlineDir, _TRUNCATE);
strncpy_s(pathToXLastFile, MAX_PATH, pathToOnlineDir, _TRUNCATE);

// Finish the paths to the XLAST file and Online directory
strncat_s(pathToXLASTFile, MAX_PATH, "\\tmp.xlast", _TRUNCATE);
strncat_s(pathToXLastFile, MAX_PATH, "\\tmp.xlast", _TRUNCATE);
strncat_s(pathToOnlineDir, MAX_PATH, "\\Online", _TRUNCATE);

// Delete the Online directory and the XLAST file
DeleteDirectory(pathToOnlineDir);
DeleteFile(pathToXLASTFile);
DeleteFile(pathToXLastFile);
}
6 changes: 3 additions & 3 deletions Publisher/src/Utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
#define SHORCUT_NAME_LENGTH 50

// Create the XML config file XLAST uses to build the shortcut.
HRESULT BuildXLASTFile(const char *shortcutName);
HRESULT BuildXLastFile(const char *shortcutName);

// Run BLAST in a separate process.
HRESULT ExecBLAST(void);
HRESULT ExecBlast(void);

// Get the path of the directory the Publisher executable lives in and write it to execDir.
HRESULT GetExecDir(char *execDir, size_t maxLength);
Expand All @@ -18,7 +18,7 @@ HRESULT GetExecDir(char *execDir, size_t maxLength);
HRESULT GetShortcutName(char *shortcutName, size_t maxLength);

// Make sure an XBDM connection is properly set up.
HRESULT CheckXBDMConnection(void);
HRESULT CheckXbdmConnection(void);

// Append %XEDK%/bin/win32 to %PATH% so that xbdm.dll can be found and delay loaded.
HRESULT AddXdkBinDirToPath(void);
Expand Down
6 changes: 3 additions & 3 deletions Publisher/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ int main()
return EXIT_FAILURE;
}

hr = CheckXBDMConnection();
hr = CheckXbdmConnection();
if (FAILED(hr))
{
system("pause");
Expand All @@ -26,14 +26,14 @@ int main()
return EXIT_FAILURE;
}

hr = BuildXLASTFile(shortcutName);
hr = BuildXLastFile(shortcutName);
if (FAILED(hr))
{
system("pause");
return EXIT_FAILURE;
}

hr = ExecBLAST();
hr = ExecBlast();
if (FAILED(hr))
{
Cleanup();
Expand Down

0 comments on commit 9f0433a

Please sign in to comment.