Don't have time to test this myself but if FileName points to an executable application, only then can you pass parameters (refer to MSDN or Win32 API Help File). You need to make sure that this is not a document, not sure if you'd receive an AV or just have the OS ignore parameters because when it's not an executable it mentions how parameters should be set to Nil. I'd do a sanity check on this first. If you do pass a parameter string to the executable, it needs to be quoted in your string
Your code is really bad. First you're allocating memory, then instead of using the allocated memory, you're changing the buffer pointer to a contant string. Finally, you're freeing the buffer pointer, which is the constant string. Basically your code has a memory leak and then tries to free a constant string. VERY bad code.
I think you need to learn about pointer programming before you even start thinking about doing API hooking...