| 398 | } |
| 399 | |
| 400 | void CustomFunctionInjector::OnCreateFile(LPCWSTR lpFileName, |
| 401 | DWORD dwDesiredAccess, |
| 402 | DWORD dwShareMode, |
| 403 | LPSECURITY_ATTRIBUTES lpSecurityAttributes, |
| 404 | DWORD dwCreationDisposition, |
| 405 | DWORD dwFlagsAndAttributes, |
| 406 | HANDLE hTemplateFile, |
| 407 | HANDLE hFile) |
| 408 | { |
| 409 | if (!extendingStory_ && (dwDesiredAccess & GENERIC_WRITE)) { |
| 410 | auto length = wcslen(lpFileName); |
| 411 | if (length > 16 && wcscmp(&lpFileName[length - 16], L"story_header.div") == 0) { |
| 412 | Debug(L"CustomFunctionInjector::OnCreateFile: %s", lpFileName); |
| 413 | storyHeaderFile_ = hFile; |
| 414 | storyHeaderPath_ = lpFileName; |
| 415 | } |
| 416 | } |
| 417 | } |
| 418 | |
| 419 | void CustomFunctionInjector::OnCloseHandle(HANDLE hFile, BOOL bSucceeded) |
| 420 | { |