Old 09-20-2021, 11:43 PM   #1
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,921
Default [SWS] Is BR_Win32_GetPrivateProfileString limited?

Is BR_Win32_GetPrivateProfileString limited to 1023 chars? Or is it an extension to Lua limit or something?

I'm trying to read "Data=" from fx preset ini files and only getting the first 1023 chars. Don't tell me I have to parse the ini by hand!
Edgemeal is offline   Reply With Quote
Old 09-20-2021, 11:59 PM   #2
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,964
Default

Quote:
Originally Posted by Edgemeal View Post
Is BR_Win32_GetPrivateProfileString limited to 1023 chars? Or is it an extension to Lua limit or something?
It's a Windows API limitation: GetPrivateProfileString requires knowing advance how much data to fetch. 1024 is the default string buffer size given to extension functions.

While the buffer size could be increased, or some hackery could automatically retry with increasingly big buffers until everything fits, I think the best short-term way would be to split large data over multiple keys.

Last edited by cfillion; 09-21-2021 at 12:08 AM.
cfillion is offline   Reply With Quote
Old 09-21-2021, 12:02 AM   #3
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,921
Default

Ya I had a feeling, oh well, Thanks!
Edgemeal is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 09:40 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.