Skip to content

Commit d186b91

Browse files
author
sourcehold
committed
refactor: ucrt seek: remove FilePtrMoveMethod and stub it with DWORD, see fileapi.h
1 parent 0d98385 commit d186b91

4 files changed

Lines changed: 6 additions & 54 deletions

File tree

src/OpenSHC/OS.func.hpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111
#include "OpenSHC/OS.hpp"
1212
#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp"
13-
#include "OpenSHC/WindowsHelper/Enums/FilePtrMoveMethodInt.hpp"
1413
#include "OpenSHC/WindowsHelper/Enums/OpenFlagInt.hpp"
1514
#include "crtdefs.h"
15+
#include "fileapi.h"
1616
#include "guiddef.h"
1717
#include "mbstring.h"
1818
#include "time.h"
@@ -21,7 +21,6 @@ namespace OpenSHC {
2121
namespace OS_Func {
2222

2323
using OpenSHC::WindowsHelper::Enums::BOOLEnum;
24-
using OpenSHC::WindowsHelper::Enums::FilePtrMoveMethodInt;
2524
using OpenSHC::WindowsHelper::Enums::OpenFlagInt;
2625

2726
MACRO_FUNCTION_RESOLVER(int*(__stdcall*)(void* param_1, uint param_2), REIMPLEMENTED_CRT,
@@ -120,7 +119,7 @@ namespace OS_Func {
120119
long(__cdecl*)(FILE* _File), REIMPLEMENTED_CRT, Address::SHC_3BB0A8C1_0x0058028F, &OpenSHC::OS::_ftell)
121120
_ftell;
122121

123-
MACRO_FUNCTION_RESOLVER(int(__cdecl*)(FILE* _File, long _Offset, FilePtrMoveMethodInt _Origin), REIMPLEMENTED_CRT,
122+
MACRO_FUNCTION_RESOLVER(int(__cdecl*)(FILE* _File, long _Offset, DWORD _Origin), REIMPLEMENTED_CRT,
124123
Address::SHC_3BB0A8C1_0x00580384, &OpenSHC::OS::_fseek)
125124
_fseek;
126125

@@ -191,7 +190,7 @@ namespace OS_Func {
191190
int(__cdecl*)(int _C), REIMPLEMENTED_CRT, Address::SHC_3BB0A8C1_0x005824CD, &OpenSHC::OS::_toupper)
192191
_toupper;
193192

194-
MACRO_FUNCTION_RESOLVER(int(__cdecl*)(int fileDescriptor, long lDistanceToMove, FilePtrMoveMethodInt moveMethod),
193+
MACRO_FUNCTION_RESOLVER(int(__cdecl*)(int fileDescriptor, long lDistanceToMove, DWORD moveMethod),
195194
REIMPLEMENTED_CRT, Address::SHC_3BB0A8C1_0x0058277E, &OpenSHC::OS::_ucrt_lseek)
196195
_ucrt_lseek;
197196

src/OpenSHC/OS.hpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
#pragma once
1010

1111
#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp"
12-
#include "OpenSHC/WindowsHelper/Enums/FilePtrMoveMethodInt.hpp"
1312
#include "OpenSHC/WindowsHelper/Enums/OpenFlagInt.hpp"
1413
#include "crtdefs.h"
14+
#include "fileapi.h"
1515
#include "guiddef.h"
1616
#include "mbstring.h"
1717
#include "time.h"
@@ -20,7 +20,6 @@ namespace OpenSHC {
2020
namespace OS {
2121

2222
using OpenSHC::WindowsHelper::Enums::BOOLEnum;
23-
using OpenSHC::WindowsHelper::Enums::FilePtrMoveMethodInt;
2423
using OpenSHC::WindowsHelper::Enums::OpenFlagInt;
2524

2625
int* __stdcall basic_ofstream_write(void* param_1, uint param_2);
@@ -71,7 +70,7 @@ namespace OS {
7170

7271
long __cdecl _ftell(FILE* _File);
7372

74-
int __cdecl _fseek(FILE* _File, long _Offset, FilePtrMoveMethodInt _Origin);
73+
int __cdecl _fseek(FILE* _File, long _Offset, DWORD _Origin);
7574

7675
FILE* __cdecl _fopen(char* _Filename, char* _Mode);
7776

@@ -107,7 +106,7 @@ namespace OS {
107106

108107
int __cdecl _toupper(int _C);
109108

110-
int __cdecl _ucrt_lseek(int fileDescriptor, long lDistanceToMove, FilePtrMoveMethodInt moveMethod);
109+
int __cdecl _ucrt_lseek(int fileDescriptor, long lDistanceToMove, DWORD moveMethod);
111110

112111
longlong __stdcall __alldiv(
113112
long dividend_lowOrder, long dividend_highOrder, long divisor_lowOrder, long divisor_highOrder);

src/OpenSHC/WindowsHelper/Enums/FilePtrMoveMethod.hpp

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/OpenSHC/WindowsHelper/Enums/FilePtrMoveMethodInt.hpp

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)