ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
April 2005
----- 2024 -----
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
26 participants
477 discussions
Start a n
N
ew thread
[weiden] 14704: use anonymous events for synchronization
by weiden@svn.reactos.com
use anonymous events for synchronization Modified: trunk/reactos/subsys/system/taskmgr/applpage.c Modified: trunk/reactos/subsys/system/taskmgr/perfpage.c Modified: trunk/reactos/subsys/system/taskmgr/procpage.c _____ Modified: trunk/reactos/subsys/system/taskmgr/applpage.c --- trunk/reactos/subsys/system/taskmgr/applpage.c 2005-04-19 17:12:03 UTC (rev 14703) +++ trunk/reactos/subsys/system/taskmgr/applpage.c 2005-04-19 17:13:34 UTC (rev 14704) @@ -213,7 +213,7 @@ DWORD WINAPI ApplicationPageRefreshThread(void *lpParameter) { /* Create the event */ - hApplicationPageEvent = CreateEvent(NULL, TRUE, TRUE, _T("Application Page Event")); + hApplicationPageEvent = CreateEvent(NULL, TRUE, TRUE, NULL); /* If we couldn't create the event then exit the thread */ if (!hApplicationPageEvent) _____ Modified: trunk/reactos/subsys/system/taskmgr/perfpage.c --- trunk/reactos/subsys/system/taskmgr/perfpage.c 2005-04-19 17:12:03 UTC (rev 14703) +++ trunk/reactos/subsys/system/taskmgr/perfpage.c 2005-04-19 17:13:34 UTC (rev 14704) @@ -320,7 +320,7 @@ TCHAR Text[260]; /* Create the event */ - hPerformancePageEvent = CreateEvent(NULL, TRUE, TRUE, _T("Performance Page Event")); + hPerformancePageEvent = CreateEvent(NULL, TRUE, TRUE, NULL); /* If we couldn't create the event then exit the thread */ if (!hPerformancePageEvent) _____ Modified: trunk/reactos/subsys/system/taskmgr/procpage.c --- trunk/reactos/subsys/system/taskmgr/procpage.c 2005-04-19 17:12:03 UTC (rev 14703) +++ trunk/reactos/subsys/system/taskmgr/procpage.c 2005-04-19 17:13:34 UTC (rev 14704) @@ -492,7 +492,7 @@ ULONG OldProcessCount = 0; /* Create the event */ - hProcessPageEvent = CreateEvent(NULL, TRUE, TRUE, _T("Process Page Event")); + hProcessPageEvent = CreateEvent(NULL, TRUE, TRUE, NULL); /* If we couldn't create the event then exit the thread */ if (!hProcessPageEvent)
19 years, 6 months
1
0
0
0
[weiden] 14702: import wininet.h from wine to solve conflicts with the w32api headers
by weiden@svn.reactos.com
import wininet.h from wine to solve conflicts with the w32api headers Added: trunk/reactos/include/wine/wininet.h Added: trunk/reactos/w32api/include/wininet.h Deleted: trunk/reactos/w32api/include/wininet.h.w32 _____ Added: trunk/reactos/include/wine/wininet.h --- trunk/reactos/include/wine/wininet.h 2005-04-19 10:40:37 UTC (rev 14701) +++ trunk/reactos/include/wine/wininet.h 2005-04-19 15:06:18 UTC (rev 14702) @@ -0,0 +1,1552 @@ +/* + * Copyright (C) 2000 Ulrich Czekalla + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef _WINE_WININET_H_ +#define _WINE_WININET_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#define INTERNETAPI +#define BOOLAPI INTERNETAPI BOOL WINAPI + +typedef LPVOID HINTERNET; +typedef HINTERNET * LPHINTERNET; + +typedef WORD INTERNET_PORT; +typedef INTERNET_PORT * LPINTERNET_PORT; + + +#define INTERNET_INVALID_PORT_NUMBER 0 + +#define INTERNET_DEFAULT_FTP_PORT 21 +#define INTERNET_DEFAULT_GOPHER_PORT 70 +#define INTERNET_DEFAULT_HTTP_PORT 80 +#define INTERNET_DEFAULT_HTTPS_PORT 443 +#define INTERNET_DEFAULT_SOCKS_PORT 1080 + +#define INTERNET_MAX_HOST_NAME_LENGTH 256 +#define INTERNET_MAX_USER_NAME_LENGTH 128 +#define INTERNET_MAX_PASSWORD_LENGTH 128 +#define INTERNET_MAX_PORT_NUMBER_LENGTH 5 +#define INTERNET_MAX_PORT_NUMBER_VALUE 65535 +#define INTERNET_MAX_PATH_LENGTH 2048 +#define INTERNET_MAX_SCHEME_LENGTH 32 +#define INTERNET_MAX_URL_LENGTH (INTERNET_MAX_SCHEME_LENGTH + sizeof("://")+ INTERNET_MAX_PATH_LENGTH) +#define INTERNET_KEEP_ALIVE_UNKNOWN ((DWORD)-1) +#define INTERNET_KEEP_ALIVE_ENABLED 1 +#define INTERNET_KEEP_ALIVE_DISABLED 0 +#define INTERNET_REQFLAG_FROM_CACHE 0x00000001 +#define INTERNET_REQFLAG_ASYNC 0x00000002 +#define INTERNET_REQFLAG_VIA_PROXY 0x00000004 +#define INTERNET_REQFLAG_NO_HEADERS 0x00000008 +#define INTERNET_REQFLAG_PASSIVE 0x00000010 +#define INTERNET_REQFLAG_CACHE_WRITE_DISABLED 0x00000040 +#define INTERNET_FLAG_RELOAD 0x80000000 +#define INTERNET_FLAG_RAW_DATA 0x40000000 +#define INTERNET_FLAG_EXISTING_CONNECT 0x20000000 +#define INTERNET_FLAG_ASYNC 0x10000000 +#define INTERNET_FLAG_PASSIVE 0x08000000 +#define INTERNET_FLAG_NO_CACHE_WRITE 0x04000000 +#define INTERNET_FLAG_DONT_CACHE INTERNET_FLAG_NO_CACHE_WRITE +#define INTERNET_FLAG_MAKE_PERSISTENT 0x02000000 +#define INTERNET_FLAG_FROM_CACHE 0x01000000 +#define INTERNET_FLAG_OFFLINE INTERNET_FLAG_FROM_CACHE +#define INTERNET_FLAG_SECURE 0x00800000 +#define INTERNET_FLAG_KEEP_CONNECTION 0x00400000 +#define INTERNET_FLAG_NO_AUTO_REDIRECT 0x00200000 +#define INTERNET_FLAG_READ_PREFETCH 0x00100000 +#define INTERNET_FLAG_NO_COOKIES 0x00080000 +#define INTERNET_FLAG_NO_AUTH 0x00040000 +#define INTERNET_FLAG_CACHE_IF_NET_FAIL 0x00010000 +#define INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP 0x00008000 +#define INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS 0x00004000 +#define INTERNET_FLAG_IGNORE_CERT_DATE_INVALID 0x00002000 +#define INTERNET_FLAG_IGNORE_CERT_CN_INVALID 0x00001000 +#define INTERNET_FLAG_RESYNCHRONIZE 0x00000800 +#define INTERNET_FLAG_HYPERLINK 0x00000400 +#define INTERNET_FLAG_NO_UI 0x00000200 +#define INTERNET_FLAG_PRAGMA_NOCACHE 0x00000100 +#define INTERNET_FLAG_CACHE_ASYNC 0x00000080 +#define INTERNET_FLAG_FORMS_SUBMIT 0x00000040 +#define INTERNET_FLAG_NEED_FILE 0x00000010 +#define INTERNET_FLAG_MUST_CACHE_REQUEST INTERNET_FLAG_NEED_FILE +#define INTERNET_FLAG_TRANSFER_ASCII FTP_TRANSFER_TYPE_ASCII +#define INTERNET_FLAG_TRANSFER_BINARY FTP_TRANSFER_TYPE_BINARY +#define SECURITY_INTERNET_MASK (INTERNET_FLAG_IGNORE_CERT_CN_INVALID|\ +INTERNET_FLAG_IGNORE_CERT_DATE_INVALID|\ +INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS|\ +INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP) + +#define INTERNET_FLAGS_MASK (INTERNET_FLAG_RELOAD \ + | INTERNET_FLAG_RAW_DATA \ + | INTERNET_FLAG_EXISTING_CONNECT \ + | INTERNET_FLAG_ASYNC \ + | INTERNET_FLAG_PASSIVE \ + | INTERNET_FLAG_NO_CACHE_WRITE \ + | INTERNET_FLAG_MAKE_PERSISTENT \ + | INTERNET_FLAG_FROM_CACHE \ + | INTERNET_FLAG_SECURE \ + | INTERNET_FLAG_KEEP_CONNECTION \ + | INTERNET_FLAG_NO_AUTO_REDIRECT \ + | INTERNET_FLAG_READ_PREFETCH \ + | INTERNET_FLAG_NO_COOKIES \ + | INTERNET_FLAG_NO_AUTH \ + | INTERNET_FLAG_CACHE_IF_NET_FAIL \ + | SECURITY_INTERNET_MASK \ + | INTERNET_FLAG_RESYNCHRONIZE \ + | INTERNET_FLAG_HYPERLINK \ + | INTERNET_FLAG_NO_UI \ + | INTERNET_FLAG_PRAGMA_NOCACHE \ + | INTERNET_FLAG_CACHE_ASYNC \ + | INTERNET_FLAG_FORMS_SUBMIT \ + | INTERNET_FLAG_NEED_FILE \ + | INTERNET_FLAG_TRANSFER_BINARY \ + | INTERNET_FLAG_TRANSFER_ASCII \ + ) + +#define INTERNET_ERROR_MASK_INSERT_CDROM 0x1 + +#define INTERNET_OPTIONS_MASK (~INTERNET_FLAGS_MASK) +#define WININET_API_FLAG_ASYNC 0x00000001 +#define WININET_API_FLAG_SYNC 0x00000004 +#define WININET_API_FLAG_USE_CONTEXT 0x00000008 +#define INTERNET_NO_CALLBACK 0 + +typedef enum { + INTERNET_SCHEME_PARTIAL = -2, + INTERNET_SCHEME_UNKNOWN = -1, + INTERNET_SCHEME_DEFAULT = 0, + INTERNET_SCHEME_FTP, + INTERNET_SCHEME_GOPHER, + INTERNET_SCHEME_HTTP, + INTERNET_SCHEME_HTTPS, + INTERNET_SCHEME_FILE, + INTERNET_SCHEME_NEWS, + INTERNET_SCHEME_MAILTO, + INTERNET_SCHEME_SOCKS, + INTERNET_SCHEME_JAVASCRIPT, + INTERNET_SCHEME_VBSCRIPT, + INTERNET_SCHEME_RES, + INTERNET_SCHEME_FIRST = INTERNET_SCHEME_FTP, + INTERNET_SCHEME_LAST = INTERNET_SCHEME_RES +} INTERNET_SCHEME,* LPINTERNET_SCHEME; + +typedef struct { + DWORD dwResult; + DWORD dwError; +} INTERNET_ASYNC_RESULT,* LPINTERNET_ASYNC_RESULT; + +typedef struct { + DWORD dwAccessType; + LPCSTR lpszProxy; + LPCSTR lpszProxyBypass; +} INTERNET_PROXY_INFOA,* LPINTERNET_PROXY_INFOA; + +typedef struct { + DWORD dwAccessType; + LPCWSTR lpszProxy; + LPCWSTR lpszProxyBypass; +} INTERNET_PROXY_INFOW,* LPINTERNET_PROXY_INFOW; + + +DECL_WINELIB_TYPE_AW(INTERNET_PROXY_INFO) +DECL_WINELIB_TYPE_AW(LPINTERNET_PROXY_INFO) + +typedef struct { + DWORD dwMajorVersion; + DWORD dwMinorVersion; +} INTERNET_VERSION_INFO,* LPINTERNET_VERSION_INFO; + +typedef struct { + DWORD dwMajorVersion; + DWORD dwMinorVersion; +} HTTP_VERSION_INFO,* LPHTTP_VERSION_INFO; + +typedef struct { + DWORD dwConnectedState; + DWORD dwFlags; +} INTERNET_CONNECTED_INFO,* LPINTERNET_CONNECTED_INFO; + +#define ISO_FORCE_DISCONNECTED 0x00000001 + +typedef struct { + DWORD dwStructSize; + LPSTR lpszScheme; + DWORD dwSchemeLength; + INTERNET_SCHEME nScheme; + LPSTR lpszHostName; + DWORD dwHostNameLength; + INTERNET_PORT nPort; + LPSTR lpszUserName; + DWORD dwUserNameLength; + LPSTR lpszPassword; + DWORD dwPasswordLength; + LPSTR lpszUrlPath; + DWORD dwUrlPathLength; + LPSTR lpszExtraInfo; + DWORD dwExtraInfoLength; +} URL_COMPONENTSA,* LPURL_COMPONENTSA; + +typedef struct { + DWORD dwStructSize; + LPWSTR lpszScheme; + DWORD dwSchemeLength; + INTERNET_SCHEME nScheme; + LPWSTR lpszHostName; + DWORD dwHostNameLength; + INTERNET_PORT nPort; + LPWSTR lpszUserName; + DWORD dwUserNameLength; + LPWSTR lpszPassword; + DWORD dwPasswordLength; + LPWSTR lpszUrlPath; + DWORD dwUrlPathLength; + LPWSTR lpszExtraInfo; + DWORD dwExtraInfoLength; +} URL_COMPONENTSW,* LPURL_COMPONENTSW; + +DECL_WINELIB_TYPE_AW(URL_COMPONENTS) +DECL_WINELIB_TYPE_AW(LPURL_COMPONENTS) + +typedef struct { + FILETIME ftExpiry; + FILETIME ftStart; + LPSTR lpszSubjectInfo; + LPSTR lpszIssuerInfo; + LPSTR lpszProtocolName; + LPSTR lpszSignatureAlgName; + LPSTR lpszEncryptionAlgName; + DWORD dwKeySize; + +} INTERNET_CERTIFICATE_INFOA,* LPINTERNET_CERTIFICATE_INFOA; + +typedef struct { + FILETIME ftExpiry; + FILETIME ftStart; + LPWSTR lpszSubjectInfo; + LPWSTR lpszIssuerInfo; + LPWSTR lpszProtocolName; + LPWSTR lpszSignatureAlgName; + LPWSTR lpszEncryptionAlgName; + DWORD dwKeySize; + +} INTERNET_CERTIFICATE_INFOW,* LPINTERNET_CERTIFICATE_INFOW; + +DECL_WINELIB_TYPE_AW(INTERNET_CERTIFICATE_INFO) +DECL_WINELIB_TYPE_AW(LPINTERNET_CERTIFICATE_INFO) + +typedef struct _INTERNET_BUFFERSA { + DWORD dwStructSize; + struct _INTERNET_BUFFERSA * Next; + LPCSTR lpcszHeader; + DWORD dwHeadersLength; + DWORD dwHeadersTotal; + LPVOID lpvBuffer; + DWORD dwBufferLength; + DWORD dwBufferTotal; + DWORD dwOffsetLow; + DWORD dwOffsetHigh; +} INTERNET_BUFFERSA,* LPINTERNET_BUFFERSA; + +typedef struct _INTERNET_BUFFERSW { + DWORD dwStructSize; + struct _INTERNET_BUFFERSW * Next; + LPCWSTR lpcszHeader; + DWORD dwHeadersLength; + DWORD dwHeadersTotal; + LPVOID lpvBuffer; + DWORD dwBufferLength; + DWORD dwBufferTotal; + DWORD dwOffsetLow; + DWORD dwOffsetHigh; +} INTERNET_BUFFERSW,* LPINTERNET_BUFFERSW; + +DECL_WINELIB_TYPE_AW(INTERNET_BUFFERS) +DECL_WINELIB_TYPE_AW(LPINTERNET_BUFFERS) + +#define GROUP_OWNER_STORAGE_SIZE 4 +#define GROUPNAME_MAX_LENGTH 120 + +typedef struct _INTERNET_CACHE_GROUP_INFOA { + DWORD dwGroupSize; + DWORD dwGroupFlags; + DWORD dwGroupType; + DWORD dwDiskUsage; + DWORD dwDiskQuota; + DWORD dwOwnerStorage[GROUP_OWNER_STORAGE_SIZE]; + CHAR szGroupName[GROUPNAME_MAX_LENGTH]; +} INTERNET_CACHE_GROUP_INFOA, * LPINTERNET_CACHE_GROUP_INFOA; + +typedef struct _INTERNET_CACHE_GROUP_INFOW { + DWORD dwGroupSize; + DWORD dwGroupFlags; + DWORD dwGroupType; + DWORD dwDiskUsage; + DWORD dwDiskQuota; + DWORD dwOwnerStorage[GROUP_OWNER_STORAGE_SIZE]; + WCHAR szGroupName[GROUPNAME_MAX_LENGTH]; +} INTERNET_CACHE_GROUP_INFOW, *LPINTERNET_CACHE_GROUP_INFOW; + +DECL_WINELIB_TYPE_AW(INTERNET_CACHE_GROUP_INFO) +DECL_WINELIB_TYPE_AW(LPINTERNET_CACHE_GROUP_INFO) + +BOOLAPI InternetTimeFromSystemTimeA(CONST SYSTEMTIME *,DWORD ,LPSTR ,DWORD); +BOOLAPI InternetTimeFromSystemTimeW(CONST SYSTEMTIME *,DWORD ,LPWSTR ,DWORD); +#define InternetTimeFromSystemTime WINELIB_NAME_AW(InternetTimeFromSystemTime) + +#define INTERNET_RFC1123_FORMAT 0 +#define INTERNET_RFC1123_BUFSIZE 30 + +BOOLAPI InternetTimeToSystemTimeA(LPCSTR ,SYSTEMTIME *,DWORD); +BOOLAPI InternetTimeToSystemTimeW(LPCWSTR ,SYSTEMTIME *,DWORD); +#define InternetTimeToSystemTime WINELIB_NAME_AW(InternetTimeToSystemTime) + +BOOLAPI InternetCrackUrlA(LPCSTR ,DWORD ,DWORD ,LPURL_COMPONENTSA); +BOOLAPI InternetCrackUrlW(LPCWSTR ,DWORD ,DWORD ,LPURL_COMPONENTSW); +#define InternetCrackUrl WINELIB_NAME_AW(InternetCrackUrl) + +BOOLAPI InternetCreateUrlA(LPURL_COMPONENTSA ,DWORD ,LPSTR ,LPDWORD); +BOOLAPI InternetCreateUrlW(LPURL_COMPONENTSW ,DWORD ,LPWSTR ,LPDWORD); +#define InternetCreateUrl WINELIB_NAME_AW(InternetCreateUrl) + +BOOLAPI InternetCanonicalizeUrlA(LPCSTR ,LPSTR ,LPDWORD ,DWORD); +BOOLAPI InternetCanonicalizeUrlW(LPCWSTR ,LPWSTR ,LPDWORD ,DWORD); +#define InternetCanonicalizeUrl WINELIB_NAME_AW(InternetCanonicalizeUrl) + +BOOLAPI InternetCombineUrlA(LPCSTR ,LPCSTR ,LPSTR ,LPDWORD ,DWORD); +BOOLAPI InternetCombineUrlW(LPCWSTR ,LPCWSTR ,LPWSTR ,LPDWORD ,DWORD); +#define InternetCombineUrl WINELIB_NAME_AW(InternetCombineUrl) + +#define ICU_ESCAPE 0x80000000 +#define ICU_USERNAME 0x40000000 +#define ICU_NO_ENCODE 0x20000000 +#define ICU_DECODE 0x10000000 +#define ICU_NO_META 0x08000000 +#define ICU_ENCODE_SPACES_ONLY 0x04000000 +#define ICU_BROWSER_MODE 0x02000000 + +INTERNETAPI HINTERNET WINAPI InternetOpenA(LPCSTR ,DWORD ,LPCSTR lpszProxy ,LPCSTR lpszProxyBypass ,DWORD); +INTERNETAPI HINTERNET WINAPI InternetOpenW(LPCWSTR ,DWORD ,LPCWSTR lpszProxy ,LPCWSTR lpszProxyBypass ,DWORD); +#define InternetOpen WINELIB_NAME_AW(InternetOpen) + +#define INTERNET_OPEN_TYPE_PRECONFIG 0 +#define INTERNET_OPEN_TYPE_DIRECT 1 +#define INTERNET_OPEN_TYPE_PROXY 3 +#define INTERNET_OPEN_TYPE_PRECONFIG_WITH_NO_AUTOPROXY 4 +#define PRE_CONFIG_INTERNET_ACCESS INTERNET_OPEN_TYPE_PRECONFIG +#define LOCAL_INTERNET_ACCESS INTERNET_OPEN_TYPE_DIRECT +#define CERN_PROXY_INTERNET_ACCESS INTERNET_OPEN_TYPE_PROXY + +BOOLAPI InternetCloseHandle(HINTERNET); + +INTERNETAPI HINTERNET WINAPI InternetConnectA(HINTERNET ,LPCSTR ,INTERNET_PORT , + LPCSTR lpszUserName ,LPCSTR lpszPassword ,DWORD ,DWORD ,DWORD ); +INTERNETAPI HINTERNET WINAPI InternetConnectW(HINTERNET ,LPCWSTR ,INTERNET_PORT , + LPCWSTR lpszUserName ,LPCWSTR lpszPassword ,DWORD ,DWORD ,DWORD ); +#define InternetConnect WINELIB_NAME_AW(InternetConnect) + +#define INTERNET_SERVICE_URL 0 +#define INTERNET_SERVICE_FTP 1 +#define INTERNET_SERVICE_GOPHER 2 +#define INTERNET_SERVICE_HTTP 3 + +#define InternetConnectUrl(hInternet,lpszUrl,dwFlags,dwContext) \ + InternetConnect(hInternet,\ + lpszUrl,\ + INTERNET_INVALID_PORT_NUMBER,\ + NULL,\ + NULL,\ + INTERNET_SERVICE_URL,\ + dwFlags,\ + dwContext \ + ) + +INTERNETAPI HINTERNET WINAPI InternetOpenUrlA(HINTERNET ,LPCSTR ,LPCSTR lpszHeaders ,DWORD ,DWORD ,DWORD); +INTERNETAPI HINTERNET WINAPI InternetOpenUrlW(HINTERNET ,LPCWSTR ,LPCWSTR lpszHeaders ,DWORD ,DWORD ,DWORD); +#define InternetOpenUrl WINELIB_NAME_AW(InternetOpenUrl) + +BOOLAPI InternetReadFile( HINTERNET ,LPVOID ,DWORD ,LPDWORD ); +INTERNETAPI BOOL WINAPI InternetReadFileExA( HINTERNET ,LPINTERNET_BUFFERSA ,DWORD ,DWORD ); +INTERNETAPI BOOL WINAPI InternetReadFileExW( HINTERNET ,LPINTERNET_BUFFERSW ,DWORD ,DWORD ); +#define InternetReadFileEx WINELIB_NAME_AW(InternetReadFileEx) + +#define IRF_ASYNC WININET_API_FLAG_ASYNC +#define IRF_SYNC WININET_API_FLAG_SYNC +#define IRF_USE_CONTEXT WININET_API_FLAG_USE_CONTEXT +#define IRF_NO_WAIT 0x00000008 + +INTERNETAPI DWORD WINAPI InternetSetFilePointer(HINTERNET ,LONG ,PVOID ,DWORD ,DWORD); +BOOLAPI InternetWriteFile(HINTERNET ,LPCVOID ,DWORD ,LPDWORD); +BOOLAPI InternetQueryDataAvailable(HINTERNET ,LPDWORD lpdwNumberOfBytesAvailable ,DWORD ,DWORD); +BOOLAPI InternetFindNextFileA(HINTERNET ,LPVOID); +BOOLAPI InternetFindNextFileW(HINTERNET ,LPVOID); +#define InternetFindNextFile WINELIB_NAME_AW(InternetFindNextFile) + +BOOLAPI InternetQueryOptionA(HINTERNET hInternet ,DWORD ,LPVOID lpBuffer ,LPDWORD); +BOOLAPI InternetQueryOptionW(HINTERNET hInternet ,DWORD ,LPVOID lpBuffer ,LPDWORD); +#define InternetQueryOption WINELIB_NAME_AW(InternetQueryOption) + +BOOLAPI InternetSetOptionA(HINTERNET hInternet ,DWORD ,LPVOID ,DWORD); +BOOLAPI InternetSetOptionW(HINTERNET hInternet ,DWORD ,LPVOID ,DWORD); +#define InternetSetOption WINELIB_NAME_AW(InternetSetOption) + +BOOLAPI InternetSetOptionExA(HINTERNET hInternet ,DWORD ,LPVOID ,DWORD ,DWORD); +BOOLAPI InternetSetOptionExW(HINTERNET hInternet ,DWORD ,LPVOID ,DWORD ,DWORD); +#define InternetSetOptionEx WINELIB_NAME_AW(InternetSetOptionEx) + +BOOLAPI InternetLockRequestFile(HINTERNET ,HANDLE *); +BOOLAPI InternetUnlockRequestFile(HANDLE); + +#define ISO_GLOBAL 0x00000001 +#define ISO_REGISTRY 0x00000002 + +#define ISO_VALID_FLAGS (ISO_GLOBAL | ISO_REGISTRY) +#define INTERNET_OPTION_CALLBACK 1 +#define INTERNET_OPTION_CONNECT_TIMEOUT 2 +#define INTERNET_OPTION_CONNECT_RETRIES 3 +#define INTERNET_OPTION_CONNECT_BACKOFF 4 +#define INTERNET_OPTION_SEND_TIMEOUT 5 +#define INTERNET_OPTION_CONTROL_SEND_TIMEOUT INTERNET_OPTION_SEND_TIMEOUT +#define INTERNET_OPTION_RECEIVE_TIMEOUT 6 +#define INTERNET_OPTION_CONTROL_RECEIVE_TIMEOUT INTERNET_OPTION_RECEIVE_TIMEOUT +#define INTERNET_OPTION_DATA_SEND_TIMEOUT 7 +#define INTERNET_OPTION_DATA_RECEIVE_TIMEOUT 8 +#define INTERNET_OPTION_HANDLE_TYPE 9 +#define INTERNET_OPTION_LISTEN_TIMEOUT 11 +#define INTERNET_OPTION_READ_BUFFER_SIZE 12 +#define INTERNET_OPTION_WRITE_BUFFER_SIZE 13 +#define INTERNET_OPTION_ASYNC_ID 15 +#define INTERNET_OPTION_ASYNC_PRIORITY 16 +#define INTERNET_OPTION_PARENT_HANDLE 21 +#define INTERNET_OPTION_KEEP_CONNECTION 22 +#define INTERNET_OPTION_REQUEST_FLAGS 23 +#define INTERNET_OPTION_EXTENDED_ERROR 24 +#define INTERNET_OPTION_OFFLINE_MODE 26 +#define INTERNET_OPTION_CACHE_STREAM_HANDLE 27 +#define INTERNET_OPTION_USERNAME 28 +#define INTERNET_OPTION_PASSWORD 29 +#define INTERNET_OPTION_ASYNC 30 +#define INTERNET_OPTION_SECURITY_FLAGS 31 +#define INTERNET_OPTION_SECURITY_CERTIFICATE_STRUCT 32 +#define INTERNET_OPTION_DATAFILE_NAME 33 +#define INTERNET_OPTION_URL 34 +#define INTERNET_OPTION_SECURITY_CERTIFICATE 35 +#define INTERNET_OPTION_SECURITY_KEY_BITNESS 36 +#define INTERNET_OPTION_REFRESH 37 +#define INTERNET_OPTION_PROXY 38 +#define INTERNET_OPTION_SETTINGS_CHANGED 39 +#define INTERNET_OPTION_VERSION 40 +#define INTERNET_OPTION_USER_AGENT 41 +#define INTERNET_OPTION_END_BROWSER_SESSION 42 +#define INTERNET_OPTION_PROXY_USERNAME 43 +#define INTERNET_OPTION_PROXY_PASSWORD 44 +#define INTERNET_OPTION_CONTEXT_VALUE 45 +#define INTERNET_OPTION_CONNECT_LIMIT 46 +#define INTERNET_OPTION_SECURITY_SELECT_CLIENT_CERT 47 +#define INTERNET_OPTION_POLICY 48 +#define INTERNET_OPTION_DISCONNECTED_TIMEOUT 49 +#define INTERNET_OPTION_CONNECTED_STATE 50 +#define INTERNET_OPTION_IDLE_STATE 51 +#define INTERNET_OPTION_OFFLINE_SEMANTICS 52 +#define INTERNET_OPTION_SECONDARY_CACHE_KEY 53 +#define INTERNET_OPTION_CALLBACK_FILTER 54 +#define INTERNET_OPTION_CONNECT_TIME 55 +#define INTERNET_OPTION_SEND_THROUGHPUT 56 +#define INTERNET_OPTION_RECEIVE_THROUGHPUT 57 +#define INTERNET_OPTION_REQUEST_PRIORITY 58 +#define INTERNET_OPTION_HTTP_VERSION 59 +#define INTERNET_OPTION_RESET_URLCACHE_SESSION 60 +#define INTERNET_OPTION_ERROR_MASK 62 +#define INTERNET_OPTION_CODEPAGE 68 +#define INTERNET_OPTION_COOKIES_3RD_PARTY 86 +#define INTERNET_OPTION_PROXY_SETTINGS_CHANGED 95 +#define INTERNET_FIRST_OPTION INTERNET_OPTION_CALLBACK +#define INTERNET_LAST_OPTION INTERNET_OPTION_PROXY_SETTINGS_CHANGED + +#define INTERNET_PRIORITY_FOREGROUND 1000 +#define INTERNET_HANDLE_TYPE_INTERNET 1 +#define INTERNET_HANDLE_TYPE_CONNECT_FTP 2 +#define INTERNET_HANDLE_TYPE_CONNECT_GOPHER 3 +#define INTERNET_HANDLE_TYPE_CONNECT_HTTP 4 +#define INTERNET_HANDLE_TYPE_FTP_FIND 5 +#define INTERNET_HANDLE_TYPE_FTP_FIND_HTML 6 +#define INTERNET_HANDLE_TYPE_FTP_FILE 7 +#define INTERNET_HANDLE_TYPE_FTP_FILE_HTML 8 +#define INTERNET_HANDLE_TYPE_GOPHER_FIND 9 +#define INTERNET_HANDLE_TYPE_GOPHER_FIND_HTML 10 +#define INTERNET_HANDLE_TYPE_GOPHER_FILE 11 +#define INTERNET_HANDLE_TYPE_GOPHER_FILE_HTML 12 +#define INTERNET_HANDLE_TYPE_HTTP_REQUEST 13 +#define SECURITY_FLAG_SECURE 0x00000001 +#define SECURITY_FLAG_STRENGTH_WEAK 0x10000000 +#define SECURITY_FLAG_STRENGTH_MEDIUM 0x40000000 +#define SECURITY_FLAG_STRENGTH_STRONG 0x20000000 +#define SECURITY_FLAG_UNKNOWNBIT 0x80000000 +#define SECURITY_FLAG_NORMALBITNESS SECURITY_FLAG_STRENGTH_WEAK +#define SECURITY_FLAG_SSL 0x00000002 +#define SECURITY_FLAG_SSL3 0x00000004 +#define SECURITY_FLAG_PCT 0x00000008 +#define SECURITY_FLAG_PCT4 0x00000010 +#define SECURITY_FLAG_IETFSSL4 0x00000020 +#define SECURITY_FLAG_40BIT SECURITY_FLAG_STRENGTH_WEAK +#define SECURITY_FLAG_128BIT SECURITY_FLAG_STRENGTH_STRONG +#define SECURITY_FLAG_56BIT SECURITY_FLAG_STRENGTH_MEDIUM +#define SECURITY_FLAG_IGNORE_REVOCATION 0x00000080 +#define SECURITY_FLAG_IGNORE_UNKNOWN_CA 0x00000100 +#define SECURITY_FLAG_IGNORE_WRONG_USAGE 0x00000200 +#define SECURITY_FLAG_IGNORE_CERT_CN_INVALID INTERNET_FLAG_IGNORE_CERT_CN_INVALID +#define SECURITY_FLAG_IGNORE_CERT_DATE_INVALID INTERNET_FLAG_IGNORE_CERT_DATE_INVALID +#define SECURITY_FLAG_IGNORE_REDIRECT_TO_HTTPS INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS +#define SECURITY_FLAG_IGNORE_REDIRECT_TO_HTTP INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP +#define SECURITY_SET_MASK (SECURITY_FLAG_IGNORE_REVOCATION |\ + SECURITY_FLAG_IGNORE_UNKNOWN_CA |\ + SECURITY_FLAG_IGNORE_CERT_CN_INVALID |\ + SECURITY_FLAG_IGNORE_CERT_DATE_INVALID |\ + SECURITY_FLAG_IGNORE_WRONG_USAGE) + + + +BOOLAPI InternetGetLastResponseInfoA(LPDWORD ,LPSTR lpszBuffer ,LPDWORD); +BOOLAPI InternetGetLastResponseInfoW(LPDWORD ,LPWSTR lpszBuffer ,LPDWORD); +#define InternetGetLastResponseInfo WINELIB_NAME_AW(InternetGetLastResponseInfo) + +typedef VOID (CALLBACK *INTERNET_STATUS_CALLBACK)(HINTERNET ,DWORD ,DWORD , + LPVOID lpvStatusInformation ,DWORD); + +typedef INTERNET_STATUS_CALLBACK * LPINTERNET_STATUS_CALLBACK; + +INTERNETAPI INTERNET_STATUS_CALLBACK WINAPI InternetSetStatusCallbackA(HINTERNET ,INTERNET_STATUS_CALLBACK); +INTERNETAPI INTERNET_STATUS_CALLBACK WINAPI InternetSetStatusCallbackW(HINTERNET ,INTERNET_STATUS_CALLBACK); +#define InternetSetStatusCallback WINELIB_NAME_AW(InternetSetStatusCallback) + +#define INTERNET_STATUS_RESOLVING_NAME 10 +#define INTERNET_STATUS_NAME_RESOLVED 11 +#define INTERNET_STATUS_CONNECTING_TO_SERVER 20 +#define INTERNET_STATUS_CONNECTED_TO_SERVER 21 +#define INTERNET_STATUS_SENDING_REQUEST 30 +#define INTERNET_STATUS_REQUEST_SENT 31 +#define INTERNET_STATUS_RECEIVING_RESPONSE 40 +#define INTERNET_STATUS_RESPONSE_RECEIVED 41 +#define INTERNET_STATUS_CTL_RESPONSE_RECEIVED 42 +#define INTERNET_STATUS_PREFETCH 43 +#define INTERNET_STATUS_CLOSING_CONNECTION 50 +#define INTERNET_STATUS_CONNECTION_CLOSED 51 +#define INTERNET_STATUS_HANDLE_CREATED 60 +#define INTERNET_STATUS_HANDLE_CLOSING 70 +#define INTERNET_STATUS_REQUEST_COMPLETE 100 +#define INTERNET_STATUS_REDIRECT 110 +#define INTERNET_STATUS_INTERMEDIATE_RESPONSE 120 +#define INTERNET_STATUS_USER_INPUT_REQUIRED 140 +#define INTERNET_STATUS_STATE_CHANGE 200 +#define INTERNET_STATUS_COOKIE_SENT 320 +#define INTERNET_STATUS_COOKIE_RECEIVED 321 +#define INTERNET_STATUS_PRIVACY_IMPACTED 324 +#define INTERNET_STATUS_P3P_HEADER 325 +#define INTERNET_STATUS_P3P_POLICYREF 326 +#define INTERNET_STATUS_COOKIE_HISTORY 327 +#define INTERNET_STATE_CONNECTED 0x00000001 +#define INTERNET_STATE_DISCONNECTED 0x00000002 +#define INTERNET_STATE_DISCONNECTED_BY_USER 0x00000010 +#define INTERNET_STATE_IDLE 0x00000100 +#define INTERNET_STATE_BUSY 0x00000200 + +#define INTERNET_INVALID_STATUS_CALLBACK ((INTERNET_STATUS_CALLBACK)(-1L)) + +#define FTP_TRANSFER_TYPE_UNKNOWN 0x00000000 +#define FTP_TRANSFER_TYPE_ASCII 0x00000001 +#define FTP_TRANSFER_TYPE_BINARY 0x00000002 +#define FTP_TRANSFER_TYPE_MASK (FTP_TRANSFER_TYPE_ASCII | FTP_TRANSFER_TYPE_BINARY) + + +INTERNETAPI HINTERNET WINAPI FtpFindFirstFileA(HINTERNET ,LPCSTR lpszSearchFile , + LPWIN32_FIND_DATAA lpFindFileData ,DWORD ,DWORD); +INTERNETAPI HINTERNET WINAPI FtpFindFirstFileW(HINTERNET ,LPCWSTR lpszSearchFile , + LPWIN32_FIND_DATAW lpFindFileData ,DWORD ,DWORD); +#define FtpFindFirstFile WINELIB_NAME_AW(FtpFindFirstFile) + +BOOLAPI FtpGetFileA(HINTERNET ,LPCSTR ,LPCSTR ,BOOL ,DWORD ,DWORD ,DWORD); +BOOLAPI FtpGetFileW(HINTERNET ,LPCWSTR ,LPCWSTR ,BOOL ,DWORD ,DWORD ,DWORD); +#define FtpGetFile WINELIB_NAME_AW(FtpGetFile) + +BOOLAPI FtpPutFileA(HINTERNET ,LPCSTR ,LPCSTR ,DWORD ,DWORD); +BOOLAPI FtpPutFileW(HINTERNET ,LPCWSTR ,LPCWSTR ,DWORD ,DWORD); +#define FtpPutFile WINELIB_NAME_AW(FtpPutFile) + +BOOLAPI FtpDeleteFileA(HINTERNET ,LPCSTR); +BOOLAPI FtpDeleteFileW(HINTERNET ,LPCWSTR); +#define FtpDeleteFile WINELIB_NAME_AW(FtpDeleteFile) + +BOOLAPI FtpRenameFileA(HINTERNET ,LPCSTR ,LPCSTR); +BOOLAPI FtpRenameFileW(HINTERNET ,LPCWSTR ,LPCWSTR); +#define FtpRenameFile WINELIB_NAME_AW(FtpRenameFile) + +INTERNETAPI HINTERNET WINAPI FtpOpenFileA(HINTERNET ,LPCSTR ,DWORD ,DWORD ,DWORD); +INTERNETAPI HINTERNET WINAPI FtpOpenFileW(HINTERNET ,LPCWSTR ,DWORD ,DWORD ,DWORD); +#define FtpOpenFile WINELIB_NAME_AW(FtpOpenFile) + +BOOLAPI FtpCreateDirectoryA(HINTERNET ,LPCSTR); +BOOLAPI FtpCreateDirectoryW(HINTERNET ,LPCWSTR); +#define FtpCreateDirectory WINELIB_NAME_AW(FtpCreateDirectory) + +BOOLAPI FtpRemoveDirectoryA(HINTERNET ,LPCSTR); +BOOLAPI FtpRemoveDirectoryW(HINTERNET ,LPCWSTR); +#define FtpRemoveDirectory WINELIB_NAME_AW(FtpRemoveDirectory) + +BOOLAPI FtpSetCurrentDirectoryA(HINTERNET ,LPCSTR); +BOOLAPI FtpSetCurrentDirectoryW(HINTERNET ,LPCWSTR); +#define FtpSetCurrentDirectory WINELIB_NAME_AW(FtpSetCurrentDirectory) + +BOOLAPI FtpGetCurrentDirectoryA(HINTERNET ,LPSTR ,LPDWORD); +BOOLAPI FtpGetCurrentDirectoryW(HINTERNET ,LPWSTR ,LPDWORD); +#define FtpGetCurrentDirectory WINELIB_NAME_AW(FtpGetCurrentDirectory) + +#define MAX_GOPHER_DISPLAY_TEXT 128 +#define MAX_GOPHER_SELECTOR_TEXT 256 +#define MAX_GOPHER_HOST_NAME INTERNET_MAX_HOST_NAME_LENGTH +#define MAX_GOPHER_LOCATOR_LENGTH (1 \ + + MAX_GOPHER_DISPLAY_TEXT \ + + 1 \ + + MAX_GOPHER_SELECTOR_TEXT \ + + 1 \ + + MAX_GOPHER_HOST_NAME \ + + 1 \ + + INTERNET_MAX_PORT_NUMBER_LENGTH \ + + 1 \ + + 1 \ + + 2 \ + ) + + +typedef struct { + CHAR DisplayString[MAX_GOPHER_DISPLAY_TEXT + 1]; + DWORD GopherType; + DWORD SizeLow; + DWORD SizeHigh; + FILETIME LastModificationTime; + CHAR Locator[MAX_GOPHER_LOCATOR_LENGTH + 1]; +} GOPHER_FIND_DATAA,* LPGOPHER_FIND_DATAA; + +typedef struct { + WCHAR DisplayString[MAX_GOPHER_DISPLAY_TEXT + 1]; + DWORD GopherType; + DWORD SizeLow; + DWORD SizeHigh; + FILETIME LastModificationTime; + WCHAR Locator[MAX_GOPHER_LOCATOR_LENGTH + 1]; +} GOPHER_FIND_DATAW,* LPGOPHER_FIND_DATAW; + +DECL_WINELIB_TYPE_AW(GOPHER_FIND_DATA) +DECL_WINELIB_TYPE_AW(LPGOPHER_FIND_DATA) + +#define GOPHER_TYPE_TEXT_FILE 0x00000001 +#define GOPHER_TYPE_DIRECTORY 0x00000002 +#define GOPHER_TYPE_CSO 0x00000004 +#define GOPHER_TYPE_ERROR 0x00000008 +#define GOPHER_TYPE_MAC_BINHEX 0x00000010 +#define GOPHER_TYPE_DOS_ARCHIVE 0x00000020 +#define GOPHER_TYPE_UNIX_UUENCODED 0x00000040 +#define GOPHER_TYPE_INDEX_SERVER 0x00000080 +#define GOPHER_TYPE_TELNET 0x00000100 +#define GOPHER_TYPE_BINARY 0x00000200 +#define GOPHER_TYPE_REDUNDANT 0x00000400 +#define GOPHER_TYPE_TN3270 0x00000800 +#define GOPHER_TYPE_GIF 0x00001000 +#define GOPHER_TYPE_IMAGE 0x00002000 +#define GOPHER_TYPE_BITMAP 0x00004000 +#define GOPHER_TYPE_MOVIE 0x00008000 +#define GOPHER_TYPE_SOUND 0x00010000 +#define GOPHER_TYPE_HTML 0x00020000 +#define GOPHER_TYPE_PDF 0x00040000 +#define GOPHER_TYPE_CALENDAR 0x00080000 +#define GOPHER_TYPE_INLINE 0x00100000 +#define GOPHER_TYPE_UNKNOWN 0x20000000 +#define GOPHER_TYPE_ASK 0x40000000 +#define GOPHER_TYPE_GOPHER_PLUS 0x80000000 + +#define IS_GOPHER_FILE(type) (BOOL)(((type) & GOPHER_TYPE_FILE_MASK) ? TRUE : FALSE) +#define IS_GOPHER_DIRECTORY(type) (BOOL)(((type) & GOPHER_TYPE_DIRECTORY) ? TRUE : FALSE) +#define IS_GOPHER_PHONE_SERVER(type) (BOOL)(((type) & GOPHER_TYPE_CSO) ? TRUE : FALSE) +#define IS_GOPHER_ERROR(type) (BOOL)(((type) & GOPHER_TYPE_ERROR) ? TRUE : FALSE) +#define IS_GOPHER_INDEX_SERVER(type) (BOOL)(((type) & GOPHER_TYPE_INDEX_SERVER) ? TRUE : FALSE) +#define IS_GOPHER_TELNET_SESSION(type) (BOOL)(((type) & GOPHER_TYPE_TELNET) ? TRUE : FALSE) +#define IS_GOPHER_BACKUP_SERVER(type) (BOOL)(((type) & GOPHER_TYPE_REDUNDANT) ? TRUE : FALSE) +#define IS_GOPHER_TN3270_SESSION(type) (BOOL)(((type) & GOPHER_TYPE_TN3270) ? TRUE : FALSE) +#define IS_GOPHER_ASK(type) (BOOL)(((type) & GOPHER_TYPE_ASK) ? TRUE : FALSE) +#define IS_GOPHER_PLUS(type) (BOOL)(((type) & GOPHER_TYPE_GOPHER_PLUS) ? TRUE : FALSE) +#define IS_GOPHER_TYPE_KNOWN(type) (BOOL)(((type) & GOPHER_TYPE_UNKNOWN) ? FALSE : TRUE) +#define GOPHER_TYPE_FILE_MASK (GOPHER_TYPE_TEXT_FILE \ + | GOPHER_TYPE_MAC_BINHEX \ + | GOPHER_TYPE_DOS_ARCHIVE \ + | GOPHER_TYPE_UNIX_UUENCODED \ + | GOPHER_TYPE_BINARY \ + | GOPHER_TYPE_GIF \ + | GOPHER_TYPE_IMAGE \ + | GOPHER_TYPE_BITMAP \ + | GOPHER_TYPE_MOVIE \ + | GOPHER_TYPE_SOUND \ + | GOPHER_TYPE_HTML \ + | GOPHER_TYPE_PDF \ + | GOPHER_TYPE_CALENDAR \ + | GOPHER_TYPE_INLINE \ + ) + + +typedef struct { + LPCSTR Comment; + LPCSTR EmailAddress; +} GOPHER_ADMIN_ATTRIBUTE_TYPEA,* LPGOPHER_ADMIN_ATTRIBUTE_TYPEA; + +typedef struct { + LPCWSTR Comment; + LPCWSTR EmailAddress; +} GOPHER_ADMIN_ATTRIBUTE_TYPEW,* LPGOPHER_ADMIN_ATTRIBUTE_TYPEW; + +DECL_WINELIB_TYPE_AW(GOPHER_ADMIN_ATTRIBUTE_TYPE) +DECL_WINELIB_TYPE_AW(LPGOPHER_ADMIN_ATTRIBUTE_TYPE) + +typedef struct { + FILETIME DateAndTime; +} GOPHER_MOD_DATE_ATTRIBUTE_TYPE,* LPGOPHER_MOD_DATE_ATTRIBUTE_TYPE; + +typedef struct { + DWORD Ttl; +} GOPHER_TTL_ATTRIBUTE_TYPE,* LPGOPHER_TTL_ATTRIBUTE_TYPE; + +typedef struct { + INT Score; +} GOPHER_SCORE_ATTRIBUTE_TYPE,* LPGOPHER_SCORE_ATTRIBUTE_TYPE; + +typedef struct { + INT LowerBound; + INT UpperBound; +} GOPHER_SCORE_RANGE_ATTRIBUTE_TYPE,* LPGOPHER_SCORE_RANGE_ATTRIBUTE_TYPE; + +typedef struct { + LPCSTR Site; +} GOPHER_SITE_ATTRIBUTE_TYPEA,* LPGOPHER_SITE_ATTRIBUTE_TYPEA; + +typedef struct { + LPCWSTR Site; +} GOPHER_SITE_ATTRIBUTE_TYPEW,* LPGOPHER_SITE_ATTRIBUTE_TYPEW; + +DECL_WINELIB_TYPE_AW(GOPHER_SITE_ATTRIBUTE_TYPE) +DECL_WINELIB_TYPE_AW(LPGOPHER_SITE_ATTRIBUTE_TYPE) + +typedef struct { + LPCSTR Organization; +} GOPHER_ORGANIZATION_ATTRIBUTE_TYPEA,* LPGOPHER_ORGANIZATION_ATTRIBUTE_TYPEA; + +typedef struct { + LPCWSTR Organization; +} GOPHER_ORGANIZATION_ATTRIBUTE_TYPEW,* LPGOPHER_ORGANIZATION_ATTRIBUTE_TYPEW; + +DECL_WINELIB_TYPE_AW(GOPHER_ORGANIZATION_ATTRIBUTE_TYPE) +DECL_WINELIB_TYPE_AW(LPGOPHER_ORGANIZATION_ATTRIBUTE_TYPE) + +typedef struct { + LPCSTR Location; +} GOPHER_LOCATION_ATTRIBUTE_TYPEA,* LPGOPHER_LOCATION_ATTRIBUTE_TYPEA; + +typedef struct { + LPCWSTR Location; +} GOPHER_LOCATION_ATTRIBUTE_TYPEW,* LPGOPHER_LOCATION_ATTRIBUTE_TYPEW; + +DECL_WINELIB_TYPE_AW(GOPHER_LOCATION_ATTRIBUTE_TYPE) +DECL_WINELIB_TYPE_AW(LPGOPHER_LOCATION_ATTRIBUTE_TYPE) + +typedef struct { + INT DegreesNorth; + INT MinutesNorth; + INT SecondsNorth; + INT DegreesEast; + INT MinutesEast; + INT SecondsEast; +} GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE,* LPGOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE; + +typedef struct { + INT Zone; +} GOPHER_TIMEZONE_ATTRIBUTE_TYPE,* LPGOPHER_TIMEZONE_ATTRIBUTE_TYPE; + +typedef struct { + LPCSTR Provider; +} GOPHER_PROVIDER_ATTRIBUTE_TYPEA,* LPGOPHER_PROVIDER_ATTRIBUTE_TYPEA; + +typedef struct { + LPCWSTR Provider; +} GOPHER_PROVIDER_ATTRIBUTE_TYPEW,* LPGOPHER_PROVIDER_ATTRIBUTE_TYPEW; + +DECL_WINELIB_TYPE_AW(GOPHER_PROVIDER_ATTRIBUTE_TYPE) +DECL_WINELIB_TYPE_AW(LPGOPHER_PROVIDER_ATTRIBUTE_TYPE) + +typedef struct { + LPCSTR Version; +} GOPHER_VERSION_ATTRIBUTE_TYPEA,* LPGOPHER_VERSION_ATTRIBUTE_TYPEA; + +typedef struct { + LPCWSTR Version; +} GOPHER_VERSION_ATTRIBUTE_TYPEW,* LPGOPHER_VERSION_ATTRIBUTE_TYPEW; + +DECL_WINELIB_TYPE_AW(GOPHER_VERSION_ATTRIBUTE_TYPE) +DECL_WINELIB_TYPE_AW(LPGOPHER_VERSION_ATTRIBUTE_TYPE) + +typedef struct { + LPCSTR ShortAbstract; + LPCSTR AbstractFile; +} GOPHER_ABSTRACT_ATTRIBUTE_TYPEA,* LPGOPHER_ABSTRACT_ATTRIBUTE_TYPEA; + +typedef struct { + LPCWSTR ShortAbstract; + LPCWSTR AbstractFile; +} GOPHER_ABSTRACT_ATTRIBUTE_TYPEW,* LPGOPHER_ABSTRACT_ATTRIBUTE_TYPEW; + +DECL_WINELIB_TYPE_AW(GOPHER_ABSTRACT_ATTRIBUTE_TYPE) +DECL_WINELIB_TYPE_AW(LPGOPHER_ABSTRACT_ATTRIBUTE_TYPE) + +typedef struct { + LPCSTR ContentType; + LPCSTR Language; + DWORD Size; +} GOPHER_VIEW_ATTRIBUTE_TYPEA,* LPGOPHER_VIEW_ATTRIBUTE_TYPEA; + +typedef struct { + LPCWSTR ContentType; + LPCWSTR Language; + DWORD Size; +} GOPHER_VIEW_ATTRIBUTE_TYPEW,* LPGOPHER_VIEW_ATTRIBUTE_TYPEW; + +DECL_WINELIB_TYPE_AW(GOPHER_VIEW_ATTRIBUTE_TYPE) +DECL_WINELIB_TYPE_AW(LPGOPHER_VIEW_ATTRIBUTE_TYPE) + +typedef struct { + BOOL TreeWalk; +} GOPHER_VERONICA_ATTRIBUTE_TYPE,* LPGOPHER_VERONICA_ATTRIBUTE_TYPE; + +typedef struct { + LPCSTR QuestionType; + LPCSTR QuestionText; +} GOPHER_ASK_ATTRIBUTE_TYPEA,* LPGOPHER_ASK_ATTRIBUTE_TYPEA; + +typedef struct { + LPCWSTR QuestionType; + LPCWSTR QuestionText; +} GOPHER_ASK_ATTRIBUTE_TYPEW,* LPGOPHER_ASK_ATTRIBUTE_TYPEW; + +DECL_WINELIB_TYPE_AW(GOPHER_ASK_ATTRIBUTE_TYPE) +DECL_WINELIB_TYPE_AW(LPGOPHER_ASK_ATTRIBUTE_TYPE) + +typedef struct { + LPCSTR Text; +} GOPHER_UNKNOWN_ATTRIBUTE_TYPEA,* LPGOPHER_UNKNOWN_ATTRIBUTE_TYPEA; + +typedef struct { + LPCWSTR Text; +} GOPHER_UNKNOWN_ATTRIBUTE_TYPEW,* LPGOPHER_UNKNOWN_ATTRIBUTE_TYPEW; + +DECL_WINELIB_TYPE_AW(GOPHER_UNKNOWN_ATTRIBUTE_TYPE) +DECL_WINELIB_TYPE_AW(LPGOPHER_UNKNOWN_ATTRIBUTE_TYPE) + +typedef struct { + DWORD CategoryId; + DWORD AttributeId; + union { + GOPHER_ADMIN_ATTRIBUTE_TYPEA Admin; + GOPHER_MOD_DATE_ATTRIBUTE_TYPE ModDate; + GOPHER_TTL_ATTRIBUTE_TYPE Ttl; + GOPHER_SCORE_ATTRIBUTE_TYPE Score; + GOPHER_SCORE_RANGE_ATTRIBUTE_TYPE ScoreRange; + GOPHER_SITE_ATTRIBUTE_TYPEA Site; + GOPHER_ORGANIZATION_ATTRIBUTE_TYPEA Organization; + GOPHER_LOCATION_ATTRIBUTE_TYPEA Location; + GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE GeographicalLocation; + GOPHER_TIMEZONE_ATTRIBUTE_TYPE TimeZone; + GOPHER_PROVIDER_ATTRIBUTE_TYPEA Provider; + GOPHER_VERSION_ATTRIBUTE_TYPEA Version; + GOPHER_ABSTRACT_ATTRIBUTE_TYPEA Abstract; + GOPHER_VIEW_ATTRIBUTE_TYPEA View; + GOPHER_VERONICA_ATTRIBUTE_TYPE Veronica; + GOPHER_ASK_ATTRIBUTE_TYPEA Ask; + GOPHER_UNKNOWN_ATTRIBUTE_TYPEA Unknown; + } AttributeType; +} GOPHER_ATTRIBUTE_TYPEA, *LPGOPHER_ATTRIBUTE_TYPEA; + +typedef struct { + DWORD CategoryId; + DWORD AttributeId; + union { + GOPHER_ADMIN_ATTRIBUTE_TYPEW Admin; + GOPHER_MOD_DATE_ATTRIBUTE_TYPE ModDate; + GOPHER_TTL_ATTRIBUTE_TYPE Ttl; + GOPHER_SCORE_ATTRIBUTE_TYPE Score; + GOPHER_SCORE_RANGE_ATTRIBUTE_TYPE ScoreRange; + GOPHER_SITE_ATTRIBUTE_TYPEW Site; + GOPHER_ORGANIZATION_ATTRIBUTE_TYPEW Organization; + GOPHER_LOCATION_ATTRIBUTE_TYPEW Location; + GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE GeographicalLocation; + GOPHER_TIMEZONE_ATTRIBUTE_TYPE TimeZone; + GOPHER_PROVIDER_ATTRIBUTE_TYPEW Provider; + GOPHER_VERSION_ATTRIBUTE_TYPEW Version; + GOPHER_ABSTRACT_ATTRIBUTE_TYPEW Abstract; + GOPHER_VIEW_ATTRIBUTE_TYPEW View; + GOPHER_VERONICA_ATTRIBUTE_TYPE Veronica; + GOPHER_ASK_ATTRIBUTE_TYPEW Ask; + GOPHER_UNKNOWN_ATTRIBUTE_TYPEW Unknown; + } AttributeType; +} GOPHER_ATTRIBUTE_TYPEW, *LPGOPHER_ATTRIBUTE_TYPEW; + +DECL_WINELIB_TYPE_AW(GOPHER_ATTRIBUTE_TYPE) +DECL_WINELIB_TYPE_AW(LPGOPHER_ATTRIBUTE_TYPE) + +#define MAX_GOPHER_CATEGORY_NAME 128 +#define MAX_GOPHER_ATTRIBUTE_NAME 128 +#define MIN_GOPHER_ATTRIBUTE_LENGTH 256 + +#define GOPHER_INFO_CATEGORY TEXT("+INFO") +#define GOPHER_ADMIN_CATEGORY TEXT("+ADMIN") +#define GOPHER_VIEWS_CATEGORY TEXT("+VIEWS") +#define GOPHER_ABSTRACT_CATEGORY TEXT("+ABSTRACT") +#define GOPHER_VERONICA_CATEGORY TEXT("+VERONICA") +#define GOPHER_ADMIN_ATTRIBUTE TEXT("Admin") +#define GOPHER_MOD_DATE_ATTRIBUTE TEXT("Mod-Date") +#define GOPHER_TTL_ATTRIBUTE TEXT("TTL") +#define GOPHER_SCORE_ATTRIBUTE TEXT("Score") +#define GOPHER_RANGE_ATTRIBUTE TEXT("Score-range") +#define GOPHER_SITE_ATTRIBUTE TEXT("Site") +#define GOPHER_ORG_ATTRIBUTE TEXT("Org") +#define GOPHER_LOCATION_ATTRIBUTE TEXT("Loc") +#define GOPHER_GEOG_ATTRIBUTE TEXT("Geog") +#define GOPHER_TIMEZONE_ATTRIBUTE TEXT("TZ") +#define GOPHER_PROVIDER_ATTRIBUTE TEXT("Provider") +#define GOPHER_VERSION_ATTRIBUTE TEXT("Version") +#define GOPHER_ABSTRACT_ATTRIBUTE TEXT("Abstract") +#define GOPHER_VIEW_ATTRIBUTE TEXT("View") +#define GOPHER_TREEWALK_ATTRIBUTE TEXT("treewalk") + +#define GOPHER_ATTRIBUTE_ID_BASE 0xabcccc00 + +#define GOPHER_CATEGORY_ID_ALL (GOPHER_ATTRIBUTE_ID_BASE + 1) +#define GOPHER_CATEGORY_ID_INFO (GOPHER_ATTRIBUTE_ID_BASE + 2) +#define GOPHER_CATEGORY_ID_ADMIN (GOPHER_ATTRIBUTE_ID_BASE + 3) +#define GOPHER_CATEGORY_ID_VIEWS (GOPHER_ATTRIBUTE_ID_BASE + 4) +#define GOPHER_CATEGORY_ID_ABSTRACT (GOPHER_ATTRIBUTE_ID_BASE + 5) +#define GOPHER_CATEGORY_ID_VERONICA (GOPHER_ATTRIBUTE_ID_BASE + 6) +#define GOPHER_CATEGORY_ID_ASK (GOPHER_ATTRIBUTE_ID_BASE + 7) +#define GOPHER_CATEGORY_ID_UNKNOWN (GOPHER_ATTRIBUTE_ID_BASE + 8) + +#define GOPHER_ATTRIBUTE_ID_ALL (GOPHER_ATTRIBUTE_ID_BASE + 9) +#define GOPHER_ATTRIBUTE_ID_ADMIN (GOPHER_ATTRIBUTE_ID_BASE + 10) +#define GOPHER_ATTRIBUTE_ID_MOD_DATE (GOPHER_ATTRIBUTE_ID_BASE + 11) +#define GOPHER_ATTRIBUTE_ID_TTL (GOPHER_ATTRIBUTE_ID_BASE + 12) +#define GOPHER_ATTRIBUTE_ID_SCORE (GOPHER_ATTRIBUTE_ID_BASE + 13) +#define GOPHER_ATTRIBUTE_ID_RANGE (GOPHER_ATTRIBUTE_ID_BASE + 14) +#define GOPHER_ATTRIBUTE_ID_SITE (GOPHER_ATTRIBUTE_ID_BASE + 15) +#define GOPHER_ATTRIBUTE_ID_ORG (GOPHER_ATTRIBUTE_ID_BASE + 16) +#define GOPHER_ATTRIBUTE_ID_LOCATION (GOPHER_ATTRIBUTE_ID_BASE + 17) +#define GOPHER_ATTRIBUTE_ID_GEOG (GOPHER_ATTRIBUTE_ID_BASE + 18) +#define GOPHER_ATTRIBUTE_ID_TIMEZONE (GOPHER_ATTRIBUTE_ID_BASE + 19) +#define GOPHER_ATTRIBUTE_ID_PROVIDER (GOPHER_ATTRIBUTE_ID_BASE + 20) +#define GOPHER_ATTRIBUTE_ID_VERSION (GOPHER_ATTRIBUTE_ID_BASE + 21) +#define GOPHER_ATTRIBUTE_ID_ABSTRACT (GOPHER_ATTRIBUTE_ID_BASE + 22) +#define GOPHER_ATTRIBUTE_ID_VIEW (GOPHER_ATTRIBUTE_ID_BASE + 23) +#define GOPHER_ATTRIBUTE_ID_TREEWALK (GOPHER_ATTRIBUTE_ID_BASE + 24) +#define GOPHER_ATTRIBUTE_ID_UNKNOWN (GOPHER_ATTRIBUTE_ID_BASE + 25) + +BOOLAPI GopherCreateLocatorA(LPCSTR ,INTERNET_PORT ,LPCSTR lpszDisplayString , + LPCSTR lpszSelectorString ,DWORD ,LPSTR lpszLocator ,LPDWORD); +BOOLAPI GopherCreateLocatorW(LPCWSTR ,INTERNET_PORT ,LPCWSTR lpszDisplayString , + LPCWSTR lpszSelectorString ,DWORD ,LPWSTR lpszLocator ,LPDWORD); +#define GopherCreateLocator WINELIB_NAME_AW(GopherCreateLocator) + +BOOLAPI GopherGetLocatorTypeA(LPCSTR ,LPDWORD); +BOOLAPI GopherGetLocatorTypeW(LPCWSTR ,LPDWORD); +#define GopherGetLocatorType WINELIB_NAME_AW(GopherGetLocatorType) + +INTERNETAPI HINTERNET WINAPI GopherFindFirstFileA(HINTERNET ,LPCSTR lpszLocator , + LPCSTR lpszSearchString ,LPGOPHER_FIND_DATAA lpFindData ,DWORD ,DWORD); +INTERNETAPI HINTERNET WINAPI GopherFindFirstFileW(HINTERNET ,LPCWSTR lpszLocator , + LPCWSTR lpszSearchString ,LPGOPHER_FIND_DATAW lpFindData ,DWORD ,DWORD); +#define GopherFindFirstFile WINELIB_NAME_AW(GopherFindFirstFile) + +INTERNETAPI HINTERNET WINAPI GopherOpenFileA(HINTERNET ,LPCSTR ,LPCSTR lpszView ,DWORD ,DWORD); +INTERNETAPI HINTERNET WINAPI GopherOpenFileW(HINTERNET ,LPCWSTR ,LPCWSTR lpszView ,DWORD ,DWORD); +#define GopherOpenFile WINELIB_NAME_AW(GopherOpenFile) + +typedef BOOL (CALLBACK *GOPHER_ATTRIBUTE_ENUMERATORA)(LPGOPHER_ATTRIBUTE_TYPEA ,DWORD); +typedef BOOL (CALLBACK *GOPHER_ATTRIBUTE_ENUMERATORW)(LPGOPHER_ATTRIBUTE_TYPEW ,DWORD); + +DECL_WINELIB_TYPE_AW(GOPHER_ATTRIBUTE_ENUMERATOR) + +BOOLAPI GopherGetAttributeA(HINTERNET ,LPCSTR ,LPCSTR lpszAttributeName ,LPBYTE , [truncated at 1000 lines; 1508 more skipped]
19 years, 6 months
1
0
0
0
[weiden] 14701: fix typo
by weiden@svn.reactos.com
fix typo Modified: trunk/reactos/lib/advapi32/advapi32.def _____ Modified: trunk/reactos/lib/advapi32/advapi32.def --- trunk/reactos/lib/advapi32/advapi32.def 2005-04-19 10:36:11 UTC (rev 14700) +++ trunk/reactos/lib/advapi32/advapi32.def 2005-04-19 10:40:37 UTC (rev 14701) @@ -414,7 +414,7 @@ MakeAbsoluteSD@44 ;MakeAbsoluteSD2 MakeSelfRelativeSD@12 -MapGenericMask(a)8=NTDLL.MapGenericMask +MapGenericMask(a)8=NTDLL.RtlMapGenericMask ;NotifyBootConfigStatus@4 NotifyChangeEventLog@8 ObjectCloseAuditAlarmA@12
19 years, 6 months
1
0
0
0
[weiden] 14700: directly redirect MapGenericMask to ntdll
by weiden@svn.reactos.com
directly redirect MapGenericMask to ntdll Modified: trunk/reactos/lib/advapi32/advapi32.def Modified: trunk/reactos/lib/advapi32/sec/misc.c _____ Modified: trunk/reactos/lib/advapi32/advapi32.def --- trunk/reactos/lib/advapi32/advapi32.def 2005-04-19 10:06:05 UTC (rev 14699) +++ trunk/reactos/lib/advapi32/advapi32.def 2005-04-19 10:36:11 UTC (rev 14700) @@ -414,7 +414,7 @@ MakeAbsoluteSD@44 ;MakeAbsoluteSD2 MakeSelfRelativeSD@12 -MapGenericMask@8 +MapGenericMask(a)8=NTDLL.MapGenericMask ;NotifyBootConfigStatus@4 NotifyChangeEventLog@8 ObjectCloseAuditAlarmA@12 _____ Modified: trunk/reactos/lib/advapi32/sec/misc.c --- trunk/reactos/lib/advapi32/sec/misc.c 2005-04-19 10:06:05 UTC (rev 14699) +++ trunk/reactos/lib/advapi32/sec/misc.c 2005-04-19 10:36:11 UTC (rev 14700) @@ -338,18 +338,6 @@ /* * @implemented */ -VOID STDCALL -MapGenericMask(PDWORD AccessMask, - PGENERIC_MAPPING GenericMapping) -{ - RtlMapGenericMask(AccessMask, - GenericMapping); -} - - -/* - * @implemented - */ BOOL STDCALL ImpersonateLoggedOnUser(HANDLE hToken) {
19 years, 6 months
1
0
0
0
[sedwards] 14694: done with wininet import
by sedwards@svn.reactos.com
done with wininet import Added: trunk/reactos/lib/wininet/Makefile.ros-template Added: trunk/reactos/lib/wininet/makefile Property changes on: trunk/reactos/lib/wininet/Makefile.in ___________________________________________________________________ Name: svn:eol-style + native _____ Added: trunk/reactos/lib/wininet/Makefile.ros-template --- trunk/reactos/lib/wininet/Makefile.ros-template 2005-04-19 05:00:05 UTC (rev 14693) +++ trunk/reactos/lib/wininet/Makefile.ros-template 2005-04-19 05:01:47 UTC (rev 14694) @@ -0,0 +1,21 @@ +# $Id: Makefile.ros-template 11910 2004-12-03 23:37:44Z blight $ + +TARGET_NAME = wininet + +TARGET_OBJECTS = @C_SRCS@ + +TARGET_CFLAGS = @EXTRADEFS@ -D__REACTOS__ + +TARGET_SDKLIBS = @IMPORTS@ wine.a wine_uuid.a ntdll.a ws2_32.a + +TARGET_BASE = $(TARGET_BASE_LIB_WININET) + +TARGET_RC_SRCS = @RC_SRCS@ +TARGET_RC_BINSRC = @RC_BINSRC@ +TARGET_RC_BINARIES = @RC_BINARIES@ + +default: all + +DEP_OBJECTS = $(TARGET_OBJECTS) + +include $(TOOLS_PATH)/depend.mk Property changes on: trunk/reactos/lib/wininet/Makefile.ros-template ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/reactos/lib/wininet/cookie.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/reactos/lib/wininet/dialogs.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/reactos/lib/wininet/ftp.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/reactos/lib/wininet/gopher.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/reactos/lib/wininet/http.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/reactos/lib/wininet/internet.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/reactos/lib/wininet/internet.h ___________________________________________________________________ Name: svn:eol-style + native _____ Added: trunk/reactos/lib/wininet/makefile --- trunk/reactos/lib/wininet/makefile 2005-04-19 05:00:05 UTC (rev 14693) +++ trunk/reactos/lib/wininet/makefile 2005-04-19 05:01:47 UTC (rev 14694) @@ -0,0 +1,9 @@ +# $Id: makefile 7409 2004-01-02 19:49:47Z gvg $ + +PATH_TO_TOP = ../.. + +TARGET_TYPE = winedll + +include $(PATH_TO_TOP)/rules.mak + +include $(TOOLS_PATH)/helper.mk Property changes on: trunk/reactos/lib/wininet/makefile ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/reactos/lib/wininet/netconnection.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/reactos/lib/wininet/resource.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/reactos/lib/wininet/rsrc.rc ___________________________________________________________________ Name: svn:eol-style + native
19 years, 6 months
2
1
0
0
[gvg] 14699: Merge 14301 - 14698 from trunk
by gvg@svn.reactos.com
Merge 14301 - 14698 from trunk Modified: branches/xen/reactos/boot/freeldr/freeldr/arch/i386/arch.S Modified: branches/xen/reactos/boot/freeldr/freeldr/arch/i386/boot.S Modified: branches/xen/reactos/boot/freeldr/freeldr/arch/i386/i386.h Modified: branches/xen/reactos/boot/freeldr/freeldr/arch/i386/i386disk.c Modified: branches/xen/reactos/boot/freeldr/freeldr/arch/i386/linux.S Modified: branches/xen/reactos/boot/freeldr/freeldr/arch/i386/machpc.c Modified: branches/xen/reactos/boot/freeldr/freeldr/arch/i386/machxbox.c Modified: branches/xen/reactos/boot/freeldr/freeldr/arch/i386/machxen.c Added: branches/xen/reactos/boot/freeldr/freeldr/arch/powerpc/ Modified: branches/xen/reactos/boot/freeldr/freeldr/bootmgr.c Modified: branches/xen/reactos/boot/freeldr/freeldr/disk/partition.c Modified: branches/xen/reactos/boot/freeldr/freeldr/fs/fs.c Deleted: branches/xen/reactos/boot/freeldr/freeldr/fs/fsrec.h Modified: branches/xen/reactos/boot/freeldr/freeldr/fs/ntfs.c Modified: branches/xen/reactos/boot/freeldr/freeldr/include/freeldr.h Modified: branches/xen/reactos/boot/freeldr/freeldr/include/fs.h Added: branches/xen/reactos/boot/freeldr/freeldr/include/fsrec.h Modified: branches/xen/reactos/boot/freeldr/freeldr/include/machine.h Modified: branches/xen/reactos/boot/freeldr/freeldr/inifile/ini.h Modified: branches/xen/reactos/boot/freeldr/freeldr/inifile/ini_init.c Modified: branches/xen/reactos/boot/freeldr/freeldr/linuxboot.c Modified: branches/xen/reactos/boot/freeldr/freeldr/machine.c Modified: branches/xen/reactos/boot/freeldr/freeldr/math/libgcc2.c Added: branches/xen/reactos/boot/freeldr/freeldr/math/powerpc.h Modified: branches/xen/reactos/boot/freeldr/freeldr/miscboot.c Modified: branches/xen/reactos/boot/freeldr/freeldr/mm/mem.h Modified: branches/xen/reactos/boot/freeldr/freeldr/reactos/arcname.c Modified: branches/xen/reactos/boot/freeldr/freeldr/reactos/reactos.c Modified: branches/xen/reactos/boot/freeldr/freeldr/reactos/setupldr.c Modified: branches/xen/reactos/boot/freeldr/freeldr/rtl/print.c Modified: branches/xen/reactos/boot/freeldr/freeldr/rtl/stdlib.c Property changes on: branches/xen/reactos/boot/freeldr/freeldr ___________________________________________________________________ Name: lastmerge + 14698 _____ Modified: branches/xen/reactos/boot/freeldr/freeldr/arch/i386/arch.S --- branches/xen/reactos/boot/freeldr/freeldr/arch/i386/arch.S 2005-04-19 08:51:16 UTC (rev 14698) +++ branches/xen/reactos/boot/freeldr/freeldr/arch/i386/arch.S 2005-04-19 10:06:05 UTC (rev 14699) @@ -47,10 +47,10 @@ .code32 /* Store the boot drive */ - movb %dl,(BootDrive) + movb %dl,(i386BootDrive) /* Store the boot partition */ - movb %dh,(BootPartition) + movb %dh,(i386BootPartition) /* GO! */ xorl %eax,%eax @@ -369,12 +369,12 @@ movl MB_INFO_BOOT_DEVICE_OFFSET(%ebx),%eax shrl $16,%eax incb %al - movb %al,BootPartition - movb %ah,BootDrive + movb %al,i386BootPartition + movb %ah,i386BootDrive jmp mb4 mb3: /* No boot device known, assume first partition of first harddisk */ - movb $0x80,BootDrive - movb $1,BootPartition + movb $0x80,i386BootDrive + movb $1,i386BootPartition mb4: /* Check for a command line */ @@ -466,8 +466,8 @@ .word 0x3ff /* Limit */ .long 0 /* Base Address */ -EXTERN(BootDrive) +EXTERN(i386BootDrive) .long 0 -EXTERN(BootPartition) +EXTERN(i386BootPartition) .long 0 _____ Modified: branches/xen/reactos/boot/freeldr/freeldr/arch/i386/boot.S --- branches/xen/reactos/boot/freeldr/freeldr/arch/i386/boot.S 2005-04-19 08:51:16 UTC (rev 14698) +++ branches/xen/reactos/boot/freeldr/freeldr/arch/i386/boot.S 2005-04-19 10:06:05 UTC (rev 14699) @@ -31,7 +31,7 @@ .code16 /* Set the boot drive */ - movb (BootDrive),%dl + movb (i386BootDrive),%dl /* Load segment registers */ cli _____ Modified: branches/xen/reactos/boot/freeldr/freeldr/arch/i386/i386.h --- branches/xen/reactos/boot/freeldr/freeldr/arch/i386/i386.h 2005-04-19 08:51:16 UTC (rev 14698) +++ branches/xen/reactos/boot/freeldr/freeldr/arch/i386/i386.h 2005-04-19 10:06:05 UTC (rev 14699) @@ -42,6 +42,19 @@ extern void (*i386TrapSaveDRHook)(unsigned long *DRRegs); +extern ULONG i386BootDrive; +extern ULONG i386BootPartition; + +extern BOOL i386DiskGetBootVolume(PULONG DriveNumber, PULONGLONG StartSector, + PULONGLONG SectorCount, int *FsType); +extern BOOL i386DiskGetSystemVolume(char *SystemPath, char *RemainingPath, + PULONG Device, PULONG DriveNumber, + PULONGLONG StartSector, + PULONGLONG SectorCount, int *FsType); +extern BOOL i386DiskGetBootPath(char *BootPath, unsigned Size); +extern VOID i386DiskGetBootDevice(PULONG BootDevice); +extern BOOL i386DiskBootingFromFloppy(VOID); + #endif /* __I386_I386_H_ */ /* EOF */ _____ Modified: branches/xen/reactos/boot/freeldr/freeldr/arch/i386/i386disk.c --- branches/xen/reactos/boot/freeldr/freeldr/arch/i386/i386disk.c 2005-04-19 08:51:16 UTC (rev 14698) +++ branches/xen/reactos/boot/freeldr/freeldr/arch/i386/i386disk.c 2005-04-19 10:06:05 UTC (rev 14699) @@ -19,6 +19,8 @@ #include "freeldr.h" #include "debug.h" +#include "i386.h" +#include "fsrec.h" //////////////////////////////////////////////////////////////////////// ///////////////////// // FUNCTIONS @@ -166,4 +168,244 @@ return TRUE; } -#endif // defined __i386__ +BOOL i386DiskGetBootVolume(PULONG DriveNumber, PULONGLONG StartSector, PULONGLONG SectorCount, int *FsType) +{ + PARTITION_TABLE_ENTRY PartitionTableEntry; + UCHAR VolumeType; + + DbgPrint((DPRINT_FILESYSTEM, "FsOpenVolume() DriveNumber: 0x%x PartitionNumber: 0x%x\n", i386BootDrive, i386BootPartition)); + + // Check and see if it is a floppy drive + // If so then just assume FAT12 file system type + if (DiskIsDriveRemovable(i386BootDrive)) + { + DbgPrint((DPRINT_FILESYSTEM, "Drive is a floppy diskette drive. Assuming FAT12 file system.\n")); + + *DriveNumber = i386BootDrive; + *StartSector = 0; + *SectorCount = 2 * 80 * 18; /* FIXME hardcoded for 1.44 Mb */ + *FsType = FS_FAT; + return TRUE; + } + + // Check for ISO9660 file system type + if (i386BootDrive >= 0x80 && FsRecIsIso9660(i386BootDrive)) + { + DbgPrint((DPRINT_FILESYSTEM, "Drive is a cdrom drive. Assuming ISO-9660 file system.\n")); + + *DriveNumber = i386BootDrive; + *StartSector = 0; + *SectorCount = 0; + *FsType = FS_ISO9660; + return TRUE; + } + + // Get the requested partition entry + if (i386BootPartition == 0) + { + // Partition requested was zero which means the boot partition + if (! DiskGetActivePartitionEntry(i386BootDrive, &PartitionTableEntry)) + { + return FALSE; + } + } + else + { + // Get requested partition + if (! MachDiskGetPartitionEntry(i386BootDrive, i386BootPartition, &PartitionTableEntry)) + { + return FALSE; + } + } + + // Check for valid partition + if (PartitionTableEntry.SystemIndicator == PARTITION_ENTRY_UNUSED) + { + return FALSE; + } + + // Try to recognize the file system + if (!FsRecognizeVolume(i386BootDrive, PartitionTableEntry.SectorCountBeforePartition, &VolumeType)) + { + return FALSE; + } + + *DriveNumber = i386BootDrive; + *StartSector = PartitionTableEntry.SectorCountBeforePartition; + *SectorCount = PartitionTableEntry.PartitionSectorCount; + + //switch (PartitionTableEntry.SystemIndicator) + switch (VolumeType) + { + case PARTITION_FAT_12: + case PARTITION_FAT_16: + case PARTITION_HUGE: + case PARTITION_XINT13: + case PARTITION_FAT32: + case PARTITION_FAT32_XINT13: + *FsType = FS_FAT; + return TRUE; + case PARTITION_EXT2: + *FsType = FS_EXT2; + return TRUE; + case PARTITION_NTFS: + *FsType = FS_NTFS; + return TRUE; + default: + *FsType = 0; + return FALSE; + } + + return TRUE; +} + +VOID +i386DiskGetBootDevice(PULONG BootDevice) +{ + ((char *)BootDevice)[0] = (char)i386BootDrive; + ((char *)BootDevice)[1] = (char)i386BootPartition; +} + +BOOL +i386DiskBootingFromFloppy(VOID) +{ + return i386BootDrive < 0x80; +} + +#define IsRecognizedPartition(P) \ + ((P) == PARTITION_FAT_12 || \ + (P) == PARTITION_FAT_16 || \ + (P) == PARTITION_HUGE || \ + (P) == PARTITION_IFS || \ + (P) == PARTITION_EXT2 || \ + (P) == PARTITION_FAT32 || \ + (P) == PARTITION_FAT32_XINT13 || \ + (P) == PARTITION_XINT13) + +BOOL i386DiskGetSystemVolume(char *SystemPath, + char *RemainingPath, + PULONG Device, + PULONG DriveNumber, + PULONGLONG StartSector, + PULONGLONG SectorCount, + int *FsType) +{ + ULONG PartitionNumber; + PARTITION_TABLE_ENTRY PartitionTableEntry; + UCHAR VolumeType; + CHAR BootPath[256]; + unsigned i, RosPartition; + + /* + * Verify system path + */ + if (!DissectArcPath(SystemPath, BootPath, DriveNumber, &PartitionNumber)) + { + return FALSE; + } + if (NULL != RemainingPath) + { + strcpy(RemainingPath, BootPath); + } + + /* 0xff -> no partition table present, use whole device */ + if (0xff == PartitionNumber) + { + PartitionTableEntry.SectorCountBeforePartition = 0; + i = 0xff; + } + else + { + /* recalculate the boot partition for freeldr */ + i = 0; + RosPartition = 0; + while (1) + { + if (!MachDiskGetPartitionEntry(*DriveNumber, ++i, &PartitionTableEntry)) + { + return FALSE; + } + if (IsRecognizedPartition(PartitionTableEntry.SystemIndicator)) + { + if (++RosPartition == PartitionNumber) + { + break; + } + } + } + } + + /* Check for ISO9660 file system type */ + if (*DriveNumber >= 0x80 && FsRecIsIso9660(*DriveNumber)) + { + DbgPrint((DPRINT_FILESYSTEM, "Drive is a cdrom drive. Assuming ISO-9660 file system.\n")); + + if (NULL != Device) + { + ((char *)Device)[0] = (char)(*DriveNumber); + ((char *)Device)[1] = (char)i; + } + *StartSector = 0; + *SectorCount = 0; + *FsType = FS_ISO9660; + return TRUE; + } + + if (!FsRecognizeVolume(*DriveNumber, PartitionTableEntry.SectorCountBeforePartition, &VolumeType)) + { + return FALSE; + } + + if (NULL != Device) + { + ((char *)Device)[0] = (char)(*DriveNumber); + ((char *)Device)[1] = (char)i; + } + *StartSector = PartitionTableEntry.SectorCountBeforePartition; + *SectorCount = PartitionTableEntry.PartitionSectorCount; + + switch (VolumeType) + { + case PARTITION_FAT_12: + case PARTITION_FAT_16: + case PARTITION_HUGE: + case PARTITION_XINT13: + case PARTITION_FAT32: + case PARTITION_FAT32_XINT13: + *FsType = FS_FAT; + return TRUE; + case PARTITION_EXT2: + *FsType = FS_EXT2; + return TRUE; + case PARTITION_NTFS: + *FsType = FS_NTFS; + return TRUE; + default: + *FsType = 0; + return FALSE; + } + + return FALSE; +} + +BOOL +i386DiskGetBootPath(char *BootPath, unsigned Size) +{ + static char Path[] = "multi(0)disk(0)"; + char Device[4]; + + itoa(i386BootDrive, Device, 10); + if (Size <= sizeof(Path) + 6 + strlen(Device)) + { + return FALSE; + } + strcpy(BootPath, Path); + strcat(BootPath, MachDiskBootingFromFloppy() ? "fdisk" : "cdrom"); + strcat(strcat(strcat(BootPath, "("), Device), ")"); + + return TRUE; +} + +#endif /* defined __i386__ */ + +/* EOF */ _____ Modified: branches/xen/reactos/boot/freeldr/freeldr/arch/i386/linux.S --- branches/xen/reactos/boot/freeldr/freeldr/arch/i386/linux.S 2005-04-19 08:51:16 UTC (rev 14698) +++ branches/xen/reactos/boot/freeldr/freeldr/arch/i386/linux.S 2005-04-19 10:06:05 UTC (rev 14699) @@ -30,7 +30,7 @@ .code16 /* Set the boot drive */ - movb (BootDrive),%dl + movb (i386BootDrive),%dl /* Load segment registers */ cli @@ -66,7 +66,7 @@ .code16 /* Set the boot drive */ - movb (BootDrive),%dl + movb (i386BootDrive),%dl /* Load segment registers */ cli _____ Modified: branches/xen/reactos/boot/freeldr/freeldr/arch/i386/machpc.c --- branches/xen/reactos/boot/freeldr/freeldr/arch/i386/machpc.c 2005-04-19 08:51:16 UTC (rev 14698) +++ branches/xen/reactos/boot/freeldr/freeldr/arch/i386/machpc.c 2005-04-19 10:06:05 UTC (rev 14699) @@ -22,6 +22,7 @@ #include "machine.h" #include "machpc.h" #include "rtl.h" +#include "i386.h" VOID PcMachInit(VOID) @@ -47,6 +48,11 @@ MachVtbl.VideoSync = PcVideoSync; MachVtbl.VideoPrepareForReactOS = PcVideoPrepareForReactOS; MachVtbl.GetMemoryMap = PcMemGetMemoryMap; + MachVtbl.DiskGetBootVolume = i386DiskGetBootVolume; + MachVtbl.DiskGetSystemVolume = i386DiskGetSystemVolume; + MachVtbl.DiskGetBootPath = i386DiskGetBootPath; + MachVtbl.DiskGetBootDevice = i386DiskGetBootDevice; + MachVtbl.DiskBootingFromFloppy = i386DiskBootingFromFloppy; MachVtbl.DiskReadLogicalSectors = PcDiskReadLogicalSectors; MachVtbl.DiskGetPartitionEntry = PcDiskGetPartitionEntry; MachVtbl.DiskGetDriveGeometry = PcDiskGetDriveGeometry; _____ Modified: branches/xen/reactos/boot/freeldr/freeldr/arch/i386/machxbox.c --- branches/xen/reactos/boot/freeldr/freeldr/arch/i386/machxbox.c 2005-04-19 08:51:16 UTC (rev 14698) +++ branches/xen/reactos/boot/freeldr/freeldr/arch/i386/machxbox.c 2005-04-19 10:06:05 UTC (rev 14699) @@ -20,6 +20,7 @@ #include "mm.h" #include "machine.h" #include "machxbox.h" +#include "i386.h" VOID XboxMachInit(VOID) @@ -45,6 +46,11 @@ MachVtbl.VideoSync = XboxVideoSync; MachVtbl.VideoPrepareForReactOS = XboxVideoPrepareForReactOS; MachVtbl.GetMemoryMap = XboxMemGetMemoryMap; + MachVtbl.DiskGetBootVolume = i386DiskGetBootVolume; + MachVtbl.DiskGetSystemVolume = i386DiskGetSystemVolume; + MachVtbl.DiskGetBootPath = i386DiskGetBootPath; + MachVtbl.DiskGetBootDevice = i386DiskGetBootDevice; + MachVtbl.DiskBootingFromFloppy = i386DiskBootingFromFloppy; MachVtbl.DiskReadLogicalSectors = XboxDiskReadLogicalSectors; MachVtbl.DiskGetPartitionEntry = XboxDiskGetPartitionEntry; MachVtbl.DiskGetDriveGeometry = XboxDiskGetDriveGeometry; _____ Modified: branches/xen/reactos/boot/freeldr/freeldr/arch/i386/machxen.c --- branches/xen/reactos/boot/freeldr/freeldr/arch/i386/machxen.c 2005-04-19 08:51:16 UTC (rev 14698) +++ branches/xen/reactos/boot/freeldr/freeldr/arch/i386/machxen.c 2005-04-19 10:06:05 UTC (rev 14699) @@ -111,6 +111,11 @@ MachVtbl.VideoSync = XenVideoSync; MachVtbl.VideoPrepareForReactOS = XenVideoPrepareForReactOS; MachVtbl.GetMemoryMap = XenMemGetMemoryMap; + MachVtbl.DiskGetBootVolume = i386DiskGetBootVolume; + MachVtbl.DiskGetSystemVolume = i386DiskGetSystemVolume; + MachVtbl.DiskGetBootPath = i386DiskGetBootPath; + MachVtbl.DiskGetBootDevice = i386DiskGetBootDevice; + MachVtbl.DiskBootingFromFloppy = i386DiskBootingFromFloppy; MachVtbl.DiskReadLogicalSectors = XenDiskReadLogicalSectors; MachVtbl.DiskGetPartitionEntry = XenDiskGetPartitionEntry; MachVtbl.DiskGetDriveGeometry = XenDiskGetDriveGeometry; @@ -179,7 +184,8 @@ /* Start freeldr */ XenActive = TRUE; - BootDrive = 0x80; + i386BootDrive = 0x80; + i386BootPartition = 0xff; BootMain(XenStartInfo->cmd_line); /* Shouldn't get here */ _____ Copied: branches/xen/reactos/boot/freeldr/freeldr/arch/powerpc (from rev 14698, trunk/reactos/boot/freeldr/freeldr/arch/powerpc) _____ Modified: branches/xen/reactos/boot/freeldr/freeldr/bootmgr.c --- branches/xen/reactos/boot/freeldr/freeldr/bootmgr.c 2005-04-19 08:51:16 UTC (rev 14698) +++ branches/xen/reactos/boot/freeldr/freeldr/bootmgr.c 2005-04-19 10:06:05 UTC (rev 14699) @@ -49,6 +49,13 @@ LONG TimeOut; ULONG SelectedOperatingSystem; + if (!FsOpenBootVolume()) + { + printf("Error opening boot partition for file access.\n"); + MachConsGetCh(); + return; + } + if (!IniFileInitialize()) { printf("Press any key to reboot.\n"); _____ Modified: branches/xen/reactos/boot/freeldr/freeldr/disk/partition.c --- branches/xen/reactos/boot/freeldr/freeldr/disk/partition.c 2005-04-19 08:51:16 UTC (rev 14698) +++ branches/xen/reactos/boot/freeldr/freeldr/disk/partition.c 2005-04-19 10:06:05 UTC (rev 14699) @@ -28,7 +28,8 @@ BOOL DiskGetActivePartitionEntry(ULONG DriveNumber, PPARTITION_TABLE_ENTRY PartitionTableEntry) { - ULONG BootablePartitionCount = 0; + ULONG BootablePartitionCount = 0; + ULONG ActivePartition = 0; MASTER_BOOT_RECORD MasterBootRecord; // Read master boot record @@ -41,22 +42,22 @@ if (MasterBootRecord.PartitionTable[0].BootIndicator == 0x80) { BootablePartitionCount++; - BootPartition = 0; + ActivePartition = 0; } if (MasterBootRecord.PartitionTable[1].BootIndicator == 0x80) { BootablePartitionCount++; - BootPartition = 1; + ActivePartition = 1; } if (MasterBootRecord.PartitionTable[2].BootIndicator == 0x80) { BootablePartitionCount++; - BootPartition = 2; + ActivePartition = 2; } if (MasterBootRecord.PartitionTable[3].BootIndicator == 0x80) { BootablePartitionCount++; - BootPartition = 3; + ActivePartition = 3; } // Make sure there was only one bootable partition @@ -72,7 +73,7 @@ } // Copy the partition table entry - RtlCopyMemory(PartitionTableEntry, &MasterBootRecord.PartitionTable[BootPartition], sizeof(PARTITION_TABLE_ENTRY)); + RtlCopyMemory(PartitionTableEntry, &MasterBootRecord.PartitionTable[ActivePartition], sizeof(PARTITION_TABLE_ENTRY)); return TRUE; } _____ Modified: branches/xen/reactos/boot/freeldr/freeldr/fs/fs.c --- branches/xen/reactos/boot/freeldr/freeldr/fs/fs.c 2005-04-19 08:51:16 UTC (rev 14698) +++ branches/xen/reactos/boot/freeldr/freeldr/fs/fs.c 2005-04-19 10:06:05 UTC (rev 14699) @@ -51,110 +51,78 @@ /* * - * BOOL FsOpenVolume(ULONG DriveNumber, ULONG PartitionNumber); + * BOOL FsOpenVolume(ULONG DriveNumber, ULONGLONG StartSector, ULONGLONG SectorCount, int Type); * * This function is called to open a disk volume for file access. * It must be called before any of the file functions will work. - * It takes two parameters: * - * Drive: The BIOS drive number of the disk to open - * Partition: This is zero for floppy drives. - * If the disk is a hard disk then this specifies - * The partition number to open (1 - 4) - * If it is zero then it opens the active (bootable) partition - * */ -BOOL FsOpenVolume(ULONG DriveNumber, ULONG PartitionNumber) +static BOOL FsOpenVolume(ULONG DriveNumber, ULONGLONG StartSector, ULONGLONG SectorCount, int Type) { - PARTITION_TABLE_ENTRY PartitionTableEntry; - UCHAR ErrorText[80]; - UCHAR VolumeType; + UCHAR ErrorText[80]; - DbgPrint((DPRINT_FILESYSTEM, "FsOpenVolume() DriveNumber: 0x%x PartitionNumber: 0x%x\n", DriveNumber, PartitionNumber)); + FsType = Type; - // Check and see if it is a floppy drive - // If so then just assume FAT12 file system type - if (DiskIsDriveRemovable(DriveNumber)) + switch (FsType) { - DbgPrint((DPRINT_FILESYSTEM, "Drive is a floppy diskette drive. Assuming FAT12 file system.\n")); - - FsType = FS_FAT; - return FatOpenVolume(DriveNumber, 0, 0); - } - - // Check for ISO9660 file system type - if (DriveNumber >= 0x80 && FsRecIsIso9660(DriveNumber)) - { - DbgPrint((DPRINT_FILESYSTEM, "Drive is a cdrom drive. Assuming ISO-9660 file system.\n")); - - FsType = FS_ISO9660; + case FS_FAT: + return FatOpenVolume(DriveNumber, StartSector, SectorCount); + case FS_EXT2: + return Ext2OpenVolume(DriveNumber, StartSector); + case FS_NTFS: + return NtfsOpenVolume(DriveNumber, StartSector); + case FS_ISO9660: return IsoOpenVolume(DriveNumber); + default: + FsType = 0; + sprintf(ErrorText, "Unsupported file system. Type: 0x%x", Type); + FileSystemError(ErrorText); } - // Set the boot partition - BootPartition = PartitionNumber; + return FALSE; +} +/* + * + * BOOL FsOpenBootVolume() + * + * This function is called to open the boot disk volume for file access. + * It must be called before any of the file functions will work. + */ +BOOL FsOpenBootVolume() +{ + ULONG DriveNumber; + ULONGLONG StartSector; + ULONGLONG SectorCount; + int Type; - // Get the requested partition entry - if (PartitionNumber == 0) + if (! MachDiskGetBootVolume(&DriveNumber, &StartSector, &SectorCount, &Type)) { - // Partition requested was zero which means the boot partition - if (DiskGetActivePartitionEntry(DriveNumber, &PartitionTableEntry) == FALSE) - { - FileSystemError("No active partition."); - return FALSE; - } - } - else - { - // Get requested partition - if (MachDiskGetPartitionEntry(DriveNumber, PartitionNumber, &PartitionTableEntry) == FALSE) - { - FileSystemError("Partition not found."); - return FALSE; - } - } - - // Check for valid partition - if (PartitionTableEntry.SystemIndicator == PARTITION_ENTRY_UNUSED) - { - FileSystemError("Invalid partition."); + FileSystemError("Unable to locate boot partition\n"); return FALSE; } - // Try to recognize the file system - if (!FsRecognizeVolume(DriveNumber, PartitionTableEntry.SectorCountBeforePartition, &VolumeType)) - { - FileSystemError("Unrecognized file system."); - return FALSE; - } + return FsOpenVolume(DriveNumber, StartSector, SectorCount, Type); +} - //switch (PartitionTableEntry.SystemIndicator) - switch (VolumeType) +BOOL FsOpenSystemVolume(char *SystemPath, char *RemainingPath, PULONG Device) +{ + ULONG DriveNumber; + ULONGLONG StartSector; + ULONGLONG SectorCount; + int Type; + + if (! MachDiskGetSystemVolume(SystemPath, RemainingPath, Device, + &DriveNumber, &StartSector, &SectorCount, + &Type)) { - case PARTITION_FAT_12: - case PARTITION_FAT_16: - case PARTITION_HUGE: - case PARTITION_XINT13: - case PARTITION_FAT32: - case PARTITION_FAT32_XINT13: - FsType = FS_FAT; - return FatOpenVolume(DriveNumber, PartitionTableEntry.SectorCountBeforePartition, PartitionTableEntry.PartitionSectorCount); - case PARTITION_EXT2: - FsType = FS_EXT2; - return Ext2OpenVolume(DriveNumber, PartitionTableEntry.SectorCountBeforePartition); - case PARTITION_NTFS: - FsType = FS_NTFS; - return NtfsOpenVolume(DriveNumber, PartitionTableEntry.SectorCountBeforePartition); - default: - FsType = 0; - sprintf(ErrorText, "Unsupported file system. Type: 0x%x", VolumeType); - FileSystemError(ErrorText); + FileSystemError("Unable to locate system partition\n"); return FALSE; } - return TRUE; + return FsOpenVolume(DriveNumber, StartSector, SectorCount, Type); } + PFILE FsOpenFile(PUCHAR FileName) { PFILE FileHandle = NULL; _____ Deleted: branches/xen/reactos/boot/freeldr/freeldr/fs/fsrec.h --- branches/xen/reactos/boot/freeldr/freeldr/fs/fsrec.h 2005-04-19 08:51:16 UTC (rev 14698) +++ branches/xen/reactos/boot/freeldr/freeldr/fs/fsrec.h 2005-04-19 10:06:05 UTC (rev 14699) @@ -1,29 +0,0 @@ -/* - * FreeLoader - * Copyright (C) 1998-2003 Brian Palmer <brianp(a)sginet.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef __FSREC_H -#define __FSREC_H - -BOOL FsRecognizeVolume(ULONG DriveNumber, ULONG VolumeStartSector, UCHAR* VolumeType); -BOOL FsRecIsIso9660(ULONG DriveNumber); -BOOL FsRecIsExt2(ULONG DriveNumber, ULONG VolumeStartSector); -BOOL FsRecIsFat(ULONG DriveNumber, ULONG VolumeStartSector); -BOOL FsRecIsNtfs(ULONG DriveNumber, ULONG VolumeStartSector); - -#endif // #defined __FSREC_H _____ Modified: branches/xen/reactos/boot/freeldr/freeldr/fs/ntfs.c --- branches/xen/reactos/boot/freeldr/freeldr/fs/ntfs.c 2005-04-19 08:51:16 UTC (rev 14698) +++ branches/xen/reactos/boot/freeldr/freeldr/fs/ntfs.c 2005-04-19 10:06:05 UTC (rev 14699) @@ -21,7 +21,7 @@ * Limitations: * - No support for compressed files. * - No attribute list support. - * - May crash on currupted filesystem. + * - May crash on corrupted filesystem. */ #include <freeldr.h> _____ Modified: branches/xen/reactos/boot/freeldr/freeldr/include/freeldr.h --- branches/xen/reactos/boot/freeldr/freeldr/include/freeldr.h 2005-04-19 08:51:16 UTC (rev 14698) +++ branches/xen/reactos/boot/freeldr/freeldr/include/freeldr.h 2005-04-19 10:06:05 UTC (rev 14699) @@ -38,8 +38,6 @@ #define ROUND_DOWN(N, S) ((N) & ~((S) - 1)) #define Ke386EraseFlags(x) __asm__ __volatile__("pushl $0 ; popfl\n") -extern ULONG BootDrive; /* BIOS boot drive, 0-A:, 1-B:, 0x80-C:, 0x81-D:, etc. */ -extern ULONG BootPartition; /* Boot Partition, 1-4 */ extern BOOL UserInterfaceUp; /* Tells us if the user interface is displayed */ VOID BootMain(LPSTR CmdLine); _____ Modified: branches/xen/reactos/boot/freeldr/freeldr/include/fs.h --- branches/xen/reactos/boot/freeldr/freeldr/include/fs.h 2005-04-19 08:51:16 UTC (rev 14698) +++ branches/xen/reactos/boot/freeldr/freeldr/include/fs.h 2005-04-19 10:06:05 UTC (rev 14699) @@ -33,7 +33,8 @@ #define PFILE FILE * VOID FileSystemError(PUCHAR ErrorString); -BOOL FsOpenVolume(ULONG DriveNumber, ULONG PartitionNumber); +BOOL FsOpenBootVolume(); +BOOL FsOpenSystemVolume(char *SystemPath, char *RemainingPath, PULONG BootDevice); PFILE FsOpenFile(PUCHAR FileName); VOID FsCloseFile(PFILE FileHandle); BOOL FsReadFile(PFILE FileHandle, ULONG BytesToRead, ULONG* BytesRead, PVOID Buffer); _____ Copied: branches/xen/reactos/boot/freeldr/freeldr/include/fsrec.h (from rev 14698, trunk/reactos/boot/freeldr/freeldr/include/fsrec.h) Property changes on: branches/xen/reactos/boot/freeldr/freeldr/include/fsrec.h ___________________________________________________________________ Name: svn:keywords + author date id revision Name: svn:eol-style + native _____ Modified: branches/xen/reactos/boot/freeldr/freeldr/include/machine.h --- branches/xen/reactos/boot/freeldr/freeldr/include/machine.h 2005-04-19 08:51:16 UTC (rev 14698) +++ branches/xen/reactos/boot/freeldr/freeldr/include/machine.h 2005-04-19 10:06:05 UTC (rev 14699) @@ -56,6 +56,11 @@ ULONG (*GetMemoryMap)(PBIOS_MEMORY_MAP BiosMemoryMap, ULONG MaxMemoryMapSize); + BOOL (*DiskGetBootVolume)(PULONG DriveNumber, PULONGLONG StartSector, PULONGLONG SectorCount, int *FsType); + BOOL (*DiskGetSystemVolume)(char *SystemPath, char *RemainingPath, PULONG Device, PULONG DriveNumber, PULONGLONG StartSector, PULONGLONG SectorCount, int *FsType); + BOOL (*DiskGetBootPath)(char *BootPath, unsigned Size); + VOID (*DiskGetBootDevice)(PULONG BootDevice); + BOOL (*DiskBootingFromFloppy)(VOID); BOOL (*DiskReadLogicalSectors)(ULONG DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer); BOOL (*DiskGetPartitionEntry)(ULONG DriveNumber, ULONG PartitionNumber, PPARTITION_TABLE_ENTRY PartitionTableEntry); BOOL (*DiskGetDriveGeometry)(ULONG DriveNumber, PGEOMETRY DriveGeometry); @@ -89,6 +94,11 @@ #define MachVideoSync() MachVtbl.VideoSync() #define MachVideoPrepareForReactOS() MachVtbl.VideoPrepareForReactOS() #define MachGetMemoryMap(MMap, Size) MachVtbl.GetMemoryMap((MMap), (Size)) +#define MachDiskGetBootVolume(Drv, Start, Cnt, FsType) MachVtbl.DiskGetBootVolume((Drv), (Start), (Cnt), (FsType)) +#define MachDiskGetSystemVolume(SysPath, RemPath, Dev, Drv, Start, Cnt, FsType) MachVtbl.DiskGetSystemVolume((SysPath), (RemPath), (Dev), (Drv), (Start), (Cnt), (FsType)) +#define MachDiskGetBootPath(Path, Size) MachVtbl.DiskGetBootPath((Path), (Size)) +#define MachDiskGetBootDevice(BootDevice) MachVtbl.DiskGetBootDevice(BootDevice) +#define MachDiskBootingFromFloppy() MachVtbl.DiskBootingFromFloppy() #define MachDiskReadLogicalSectors(Drive, Start, Count, Buf) MachVtbl.DiskReadLogicalSectors((Drive), (Start), (Count), (Buf)) #define MachDiskGetPartitionEntry(Drive, Part, Entry) MachVtbl.DiskGetPartitionEntry((Drive), (Part), (Entry)) #define MachDiskGetDriveGeometry(Drive, Geom) MachVtbl.DiskGetDriveGeometry((Drive), (Geom)) _____ Modified: branches/xen/reactos/boot/freeldr/freeldr/inifile/ini.h --- branches/xen/reactos/boot/freeldr/freeldr/inifile/ini.h 2005-04-19 08:51:16 UTC (rev 14698) +++ branches/xen/reactos/boot/freeldr/freeldr/inifile/ini.h 2005-04-19 10:06:05 UTC (rev 14699) @@ -57,7 +57,7 @@ extern ULONG IniFileSectionCount; extern ULONG IniFileSettingCount; -PFILE IniOpenIniFile(UCHAR BootDriveNumber, UCHAR BootPartitionNumber); +PFILE IniOpenIniFile(); BOOL IniParseFile(PUCHAR IniFileData, ULONG IniFileSize); ULONG IniGetNextLineSize(PUCHAR IniFileData, ULONG IniFileSize, ULONG CurrentOffset); _____ Modified: branches/xen/reactos/boot/freeldr/freeldr/inifile/ini_init.c --- branches/xen/reactos/boot/freeldr/freeldr/inifile/ini_init.c 2005-04-19 08:51:16 UTC (rev 14698) +++ branches/xen/reactos/boot/freeldr/freeldr/inifile/ini_init.c 2005-04-19 10:06:05 UTC (rev 14699) @@ -33,23 +33,8 @@ BOOL Success; // Open freeldr.ini - // BootDrive & BootPartition are passed - // in from the boot sector code in the - // DL & DH registers. - Freeldr_Ini = IniOpenIniFile(BootDrive, BootPartition); + Freeldr_Ini = IniOpenIniFile(); - // If we couldn't open freeldr.ini on the partition - // they specified in the boot sector then try - // opening the active (boot) partition. - if ((Freeldr_Ini == NULL) && (BootPartition != 0)) - { - BootPartition = 0; - - Freeldr_Ini = IniOpenIniFile(BootDrive, BootPartition); - - return FALSE; - } - if (Freeldr_Ini == NULL) { printf("Error opening freeldr.ini or file not found.\n"); @@ -87,24 +72,10 @@ return Success; } -PFILE IniOpenIniFile(UCHAR BootDriveNumber, UCHAR BootPartitionNumber) +PFILE IniOpenIniFile() { PFILE IniFileHandle; // File handle for freeldr.ini - if (!FsOpenVolume(BootDriveNumber, BootPartitionNumber)) - { - if (BootPartitionNumber == 0) - { - printf("Error opening active (bootable) partition on boot drive 0x%x for file access.\n", BootDriveNumber); - } - else - { - printf("Error opening partition %d on boot drive 0x%x for file access.\n", BootPartitionNumber, BootDriveNumber); - } - - return NULL; - } - // Try to open freeldr.ini IniFileHandle = FsOpenFile("freeldr.ini"); _____ Modified: branches/xen/reactos/boot/freeldr/freeldr/linuxboot.c --- branches/xen/reactos/boot/freeldr/freeldr/linuxboot.c 2005-04-19 08:51:16 UTC (rev 14698) +++ branches/xen/reactos/boot/freeldr/freeldr/linuxboot.c 2005-04-19 10:06:05 UTC (rev 14699) @@ -40,18 +40,19 @@ PLINUX_BOOTSECTOR LinuxBootSector = NULL; PLINUX_SETUPSECTOR LinuxSetupSector = NULL; -ULONG SetupSectorSize = 0; -BOOL NewStyleLinuxKernel = FALSE; -ULONG LinuxKernelSize = 0; -ULONG LinuxInitrdSize = 0; -UCHAR LinuxKernelName[260]; -UCHAR LinuxInitrdName[260]; -BOOL LinuxHasInitrd = FALSE; -UCHAR LinuxCommandLine[260] = ""; -ULONG LinuxCommandLineSize = 0; -PVOID LinuxKernelLoadAddress = NULL; -PVOID LinuxInitrdLoadAddress = NULL; -UCHAR LinuxBootDescription[80]; +ULONG SetupSectorSize = 0; +BOOL NewStyleLinuxKernel = FALSE; +ULONG LinuxKernelSize = 0; +ULONG LinuxInitrdSize = 0; +UCHAR LinuxKernelName[260]; +UCHAR LinuxInitrdName[260]; +BOOL LinuxHasInitrd = FALSE; +UCHAR LinuxCommandLine[260] = ""; +ULONG LinuxCommandLineSize = 0; +PVOID LinuxKernelLoadAddress = NULL; +PVOID LinuxInitrdLoadAddress = NULL; +UCHAR LinuxBootDescription[80]; +UCHAR LinuxBootPath[260] = ""; VOID LoadAndBootLinux(PUCHAR OperatingSystemName, PUCHAR Description) { @@ -80,7 +81,7 @@ } // Open the boot volume - if (!FsOpenVolume(BootDrive, BootPartition)) + if (!FsOpenSystemVolume(LinuxBootPath, NULL, NULL)) { UiMessageBox("Failed to open boot drive."); goto LinuxBootFailed; @@ -226,8 +227,7 @@ BOOL LinuxParseIniSection(PUCHAR OperatingSystemName) { UCHAR SettingName[260]; - UCHAR SettingValue[260]; - ULONG SectionId; + ULONG SectionId; // Find all the message box settings and run them UiShowMessageBoxesInSection(OperatingSystemName); @@ -240,20 +240,12 @@ return FALSE; } - if (!IniReadSettingByName(SectionId, "BootDrive", SettingValue, 260)) + if (!IniReadSettingByName(SectionId, "BootPath", LinuxBootPath, 260)) { - UiMessageBox("Boot drive not specified for selected OS!"); + UiMessageBox("Boot path not specified for selected OS!"); return FALSE; } - BootDrive = DriveMapGetBiosDriveNumber(SettingValue); - - BootPartition = 0; - if (IniReadSettingByName(SectionId, "BootPartition", SettingValue, 260)) - { - BootPartition = atoi(SettingValue); - } - // Get the kernel name if (!IniReadSettingByName(SectionId, "Kernel", LinuxKernelName, 260)) { _____ Modified: branches/xen/reactos/boot/freeldr/freeldr/machine.c --- branches/xen/reactos/boot/freeldr/freeldr/machine.c 2005-04-19 08:51:16 UTC (rev 14698) +++ branches/xen/reactos/boot/freeldr/freeldr/machine.c 2005-04-19 10:06:05 UTC (rev 14699) @@ -37,6 +37,11 @@ #undef MachVideoSync #undef MachVideoPrepareForReactOS #undef MachGetMemoryMap +#undef MachDiskGetBootVolume +#undef MachDiskGetSystemVolume +#undef MachDiskGetBootPath +#undef MachDiskGetBootDevice +#undef MachDiskBootingFromFloppy #undef MachDiskReadLogicalSectors #undef MachDiskGetPartitionEntry #undef MachDiskGetDriveGeometry @@ -150,6 +155,44 @@ } BOOL +MachDiskGetBootVolume(PULONG DriveNumber, PULONGLONG StartSector, PULONGLONG SectorCount, int *FsType) +{ + return MachVtbl.DiskGetBootVolume(DriveNumber, StartSector, SectorCount, FsType); +} + +BOOL +MachDiskGetSystemVolume(char *SystemPath, + char *RemainingPath, + PULONG Device, + PULONG DriveNumber, + PULONGLONG StartSector, + PULONGLONG SectorCount, + int *FsType) +{ + return MachVtbl.DiskGetSystemVolume(SystemPath, RemainingPath, Device, + DriveNumber, StartSector, SectorCount, + FsType); +} + +BOOL +MachDiskGetBootPath(char *BootPath, unsigned Size) +{ + return MachVtbl.DiskGetBootPath(BootPath, Size); +} + +VOID +MachDiskGetBootDevice(PULONG BootDevice) +{ + MachVtbl.DiskGetBootDevice(BootDevice); +} + +BOOL +MachDiskBootingFromFloppy() +{ + return MachVtbl.DiskBootingFromFloppy(); +} + +BOOL MachDiskReadLogicalSectors(ULONG DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer) { return MachVtbl.DiskReadLogicalSectors(DriveNumber, SectorNumber, SectorCount, Buffer); _____ Modified: branches/xen/reactos/boot/freeldr/freeldr/math/libgcc2.c --- branches/xen/reactos/boot/freeldr/freeldr/math/libgcc2.c 2005-04-19 08:51:16 UTC (rev 14698) +++ branches/xen/reactos/boot/freeldr/freeldr/math/libgcc2.c 2005-04-19 10:06:05 UTC (rev 14699) @@ -38,6 +38,8 @@ */ #ifdef __i386__ #include "i386.h" +#elif defined(_M_PPC) +#include "powerpc.h" #endif [truncated at 1000 lines; 541 more skipped]
19 years, 6 months
1
0
0
0
[gvg] 14698: Make disk partition handling architecture dependent, as not
by gvg@svn.reactos.com
Make disk partition handling architecture dependent, as not all architectures have partitions Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/arch.S Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/boot.S Added: trunk/reactos/boot/freeldr/freeldr/arch/i386/i386.h Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/i386disk.c Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/linux.S Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/machpc.c Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/machxbox.c Modified: trunk/reactos/boot/freeldr/freeldr/bootmgr.c Modified: trunk/reactos/boot/freeldr/freeldr/disk/partition.c Modified: trunk/reactos/boot/freeldr/freeldr/fs/fs.c Deleted: trunk/reactos/boot/freeldr/freeldr/fs/fsrec.h Modified: trunk/reactos/boot/freeldr/freeldr/include/freeldr.h Modified: trunk/reactos/boot/freeldr/freeldr/include/fs.h Added: trunk/reactos/boot/freeldr/freeldr/include/fsrec.h Modified: trunk/reactos/boot/freeldr/freeldr/include/machine.h Modified: trunk/reactos/boot/freeldr/freeldr/inifile/ini.h Modified: trunk/reactos/boot/freeldr/freeldr/inifile/ini_init.c Modified: trunk/reactos/boot/freeldr/freeldr/linuxboot.c Modified: trunk/reactos/boot/freeldr/freeldr/machine.c Modified: trunk/reactos/boot/freeldr/freeldr/miscboot.c Modified: trunk/reactos/boot/freeldr/freeldr/reactos/arcname.c Modified: trunk/reactos/boot/freeldr/freeldr/reactos/reactos.c Modified: trunk/reactos/boot/freeldr/freeldr/reactos/setupldr.c _____ Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/arch.S --- trunk/reactos/boot/freeldr/freeldr/arch/i386/arch.S 2005-04-19 06:26:01 UTC (rev 14697) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/arch.S 2005-04-19 08:51:16 UTC (rev 14698) @@ -47,10 +47,10 @@ .code32 /* Store the boot drive */ - movb %dl,(_BootDrive) + movb %dl,(_i386BootDrive) /* Store the boot partition */ - movb %dh,(_BootPartition) + movb %dh,(_i386BootPartition) /* GO! */ xorl %eax,%eax @@ -365,12 +365,12 @@ movl MB_INFO_BOOT_DEVICE_OFFSET(%ebx),%eax shrl $16,%eax incb %al - movb %al,_BootPartition - movb %ah,_BootDrive + movb %al,_i386BootPartition + movb %ah,_i386BootDrive jmp mb4 mb3: /* No boot device known, assume first partition of first harddisk */ - movb $0x80,_BootDrive - movb $1,_BootPartition + movb $0x80,_i386BootDrive + movb $1,_i386BootPartition mb4: /* Check for a command line */ @@ -462,8 +462,8 @@ .word 0x3ff /* Limit */ .long 0 /* Base Address */ -EXTERN(_BootDrive) +EXTERN(_i386BootDrive) .long 0 -EXTERN(_BootPartition) +EXTERN(_i386BootPartition) .long 0 _____ Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/boot.S --- trunk/reactos/boot/freeldr/freeldr/arch/i386/boot.S 2005-04-19 06:26:01 UTC (rev 14697) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/boot.S 2005-04-19 08:51:16 UTC (rev 14698) @@ -31,7 +31,7 @@ .code16 /* Set the boot drive */ - movb (_BootDrive),%dl + movb (_i386BootDrive),%dl /* Load segment registers */ cli _____ Added: trunk/reactos/boot/freeldr/freeldr/arch/i386/i386.h --- trunk/reactos/boot/freeldr/freeldr/arch/i386/i386.h 2005-04-19 06:26:01 UTC (rev 14697) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/i386.h 2005-04-19 08:51:16 UTC (rev 14698) @@ -0,0 +1,40 @@ +/* + * FreeLoader + * + * Copyright (C) 2003 Eric Kohl + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef __I386_I386_H_ +#define __I386_I386_H_ + + +extern ULONG i386BootDrive; +extern ULONG i386BootPartition; + +extern BOOL i386DiskGetBootVolume(PULONG DriveNumber, PULONGLONG StartSector, + PULONGLONG SectorCount, int *FsType); +extern BOOL i386DiskGetSystemVolume(char *SystemPath, char *RemainingPath, + PULONG Device, PULONG DriveNumber, + PULONGLONG StartSector, + PULONGLONG SectorCount, int *FsType); +extern BOOL i386DiskGetBootPath(char *BootPath, unsigned Size); +extern VOID i386DiskGetBootDevice(PULONG BootDevice); +extern BOOL i386DiskBootingFromFloppy(VOID); + +#endif /* __I386_I386_H_ */ + +/* EOF */ Property changes on: trunk/reactos/boot/freeldr/freeldr/arch/i386/i386.h ___________________________________________________________________ Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native _____ Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/i386disk.c --- trunk/reactos/boot/freeldr/freeldr/arch/i386/i386disk.c 2005-04-19 06:26:01 UTC (rev 14697) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/i386disk.c 2005-04-19 08:51:16 UTC (rev 14698) @@ -19,6 +19,8 @@ #include "freeldr.h" #include "debug.h" +#include "i386.h" +#include "fsrec.h" //////////////////////////////////////////////////////////////////////// ///////////////////// // FUNCTIONS @@ -166,4 +168,244 @@ return TRUE; } -#endif // defined __i386__ +BOOL i386DiskGetBootVolume(PULONG DriveNumber, PULONGLONG StartSector, PULONGLONG SectorCount, int *FsType) +{ + PARTITION_TABLE_ENTRY PartitionTableEntry; + UCHAR VolumeType; + + DbgPrint((DPRINT_FILESYSTEM, "FsOpenVolume() DriveNumber: 0x%x PartitionNumber: 0x%x\n", i386BootDrive, i386BootPartition)); + + // Check and see if it is a floppy drive + // If so then just assume FAT12 file system type + if (DiskIsDriveRemovable(i386BootDrive)) + { + DbgPrint((DPRINT_FILESYSTEM, "Drive is a floppy diskette drive. Assuming FAT12 file system.\n")); + + *DriveNumber = i386BootDrive; + *StartSector = 0; + *SectorCount = 2 * 80 * 18; /* FIXME hardcoded for 1.44 Mb */ + *FsType = FS_FAT; + return TRUE; + } + + // Check for ISO9660 file system type + if (i386BootDrive >= 0x80 && FsRecIsIso9660(i386BootDrive)) + { + DbgPrint((DPRINT_FILESYSTEM, "Drive is a cdrom drive. Assuming ISO-9660 file system.\n")); + + *DriveNumber = i386BootDrive; + *StartSector = 0; + *SectorCount = 0; + *FsType = FS_ISO9660; + return TRUE; + } + + // Get the requested partition entry + if (i386BootPartition == 0) + { + // Partition requested was zero which means the boot partition + if (! DiskGetActivePartitionEntry(i386BootDrive, &PartitionTableEntry)) + { + return FALSE; + } + } + else + { + // Get requested partition + if (! MachDiskGetPartitionEntry(i386BootDrive, i386BootPartition, &PartitionTableEntry)) + { + return FALSE; + } + } + + // Check for valid partition + if (PartitionTableEntry.SystemIndicator == PARTITION_ENTRY_UNUSED) + { + return FALSE; + } + + // Try to recognize the file system + if (!FsRecognizeVolume(i386BootDrive, PartitionTableEntry.SectorCountBeforePartition, &VolumeType)) + { + return FALSE; + } + + *DriveNumber = i386BootDrive; + *StartSector = PartitionTableEntry.SectorCountBeforePartition; + *SectorCount = PartitionTableEntry.PartitionSectorCount; + + //switch (PartitionTableEntry.SystemIndicator) + switch (VolumeType) + { + case PARTITION_FAT_12: + case PARTITION_FAT_16: + case PARTITION_HUGE: + case PARTITION_XINT13: + case PARTITION_FAT32: + case PARTITION_FAT32_XINT13: + *FsType = FS_FAT; + return TRUE; + case PARTITION_EXT2: + *FsType = FS_EXT2; + return TRUE; + case PARTITION_NTFS: + *FsType = FS_NTFS; + return TRUE; + default: + *FsType = 0; + return FALSE; + } + + return TRUE; +} + +VOID +i386DiskGetBootDevice(PULONG BootDevice) +{ + ((char *)BootDevice)[0] = (char)i386BootDrive; + ((char *)BootDevice)[1] = (char)i386BootPartition; +} + +BOOL +i386DiskBootingFromFloppy(VOID) +{ + return i386BootDrive < 0x80; +} + +#define IsRecognizedPartition(P) \ + ((P) == PARTITION_FAT_12 || \ + (P) == PARTITION_FAT_16 || \ + (P) == PARTITION_HUGE || \ + (P) == PARTITION_IFS || \ + (P) == PARTITION_EXT2 || \ + (P) == PARTITION_FAT32 || \ + (P) == PARTITION_FAT32_XINT13 || \ + (P) == PARTITION_XINT13) + +BOOL i386DiskGetSystemVolume(char *SystemPath, + char *RemainingPath, + PULONG Device, + PULONG DriveNumber, + PULONGLONG StartSector, + PULONGLONG SectorCount, + int *FsType) +{ + ULONG PartitionNumber; + PARTITION_TABLE_ENTRY PartitionTableEntry; + UCHAR VolumeType; + CHAR BootPath[256]; + unsigned i, RosPartition; + + /* + * Verify system path + */ + if (!DissectArcPath(SystemPath, BootPath, DriveNumber, &PartitionNumber)) + { + return FALSE; + } + if (NULL != RemainingPath) + { + strcpy(RemainingPath, BootPath); + } + + /* 0xff -> no partition table present, use whole device */ + if (0xff == PartitionNumber) + { + PartitionTableEntry.SectorCountBeforePartition = 0; + i = 0xff; + } + else + { + /* recalculate the boot partition for freeldr */ + i = 0; + RosPartition = 0; + while (1) + { + if (!MachDiskGetPartitionEntry(*DriveNumber, ++i, &PartitionTableEntry)) + { + return FALSE; + } + if (IsRecognizedPartition(PartitionTableEntry.SystemIndicator)) + { + if (++RosPartition == PartitionNumber) + { + break; + } + } + } + } + + /* Check for ISO9660 file system type */ + if (*DriveNumber >= 0x80 && FsRecIsIso9660(*DriveNumber)) + { + DbgPrint((DPRINT_FILESYSTEM, "Drive is a cdrom drive. Assuming ISO-9660 file system.\n")); + + if (NULL != Device) + { + ((char *)Device)[0] = (char)(*DriveNumber); + ((char *)Device)[1] = (char)i; + } + *StartSector = 0; + *SectorCount = 0; + *FsType = FS_ISO9660; + return TRUE; + } + + if (!FsRecognizeVolume(*DriveNumber, PartitionTableEntry.SectorCountBeforePartition, &VolumeType)) + { + return FALSE; + } + + if (NULL != Device) + { + ((char *)Device)[0] = (char)(*DriveNumber); + ((char *)Device)[1] = (char)i; + } + *StartSector = PartitionTableEntry.SectorCountBeforePartition; + *SectorCount = PartitionTableEntry.PartitionSectorCount; + + switch (VolumeType) + { + case PARTITION_FAT_12: + case PARTITION_FAT_16: + case PARTITION_HUGE: + case PARTITION_XINT13: + case PARTITION_FAT32: + case PARTITION_FAT32_XINT13: + *FsType = FS_FAT; + return TRUE; + case PARTITION_EXT2: + *FsType = FS_EXT2; + return TRUE; + case PARTITION_NTFS: + *FsType = FS_NTFS; + return TRUE; + default: + *FsType = 0; + return FALSE; + } + + return FALSE; +} + +BOOL +i386DiskGetBootPath(char *BootPath, unsigned Size) +{ + static char Path[] = "multi(0)disk(0)"; + char Device[4]; + + itoa(i386BootDrive, Device, 10); + if (Size <= sizeof(Path) + 6 + strlen(Device)) + { + return FALSE; + } + strcpy(BootPath, Path); + strcat(BootPath, MachDiskBootingFromFloppy() ? "fdisk" : "cdrom"); + strcat(strcat(strcat(BootPath, "("), Device), ")"); + + return TRUE; +} + +#endif /* defined __i386__ */ + +/* EOF */ _____ Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/linux.S --- trunk/reactos/boot/freeldr/freeldr/arch/i386/linux.S 2005-04-19 06:26:01 UTC (rev 14697) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/linux.S 2005-04-19 08:51:16 UTC (rev 14698) @@ -30,7 +30,7 @@ .code16 /* Set the boot drive */ - movb (_BootDrive),%dl + movb (_i386BootDrive),%dl /* Load segment registers */ cli @@ -66,7 +66,7 @@ .code16 /* Set the boot drive */ - movb (_BootDrive),%dl + movb (_i386BootDrive),%dl /* Load segment registers */ cli _____ Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/machpc.c --- trunk/reactos/boot/freeldr/freeldr/arch/i386/machpc.c 2005-04-19 06:26:01 UTC (rev 14697) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/machpc.c 2005-04-19 08:51:16 UTC (rev 14698) @@ -23,6 +23,7 @@ #include "machine.h" #include "machpc.h" #include "rtl.h" +#include "i386.h" VOID PcMachInit(VOID) @@ -48,6 +49,11 @@ MachVtbl.VideoSync = PcVideoSync; MachVtbl.VideoPrepareForReactOS = PcVideoPrepareForReactOS; MachVtbl.GetMemoryMap = PcMemGetMemoryMap; + MachVtbl.DiskGetBootVolume = i386DiskGetBootVolume; + MachVtbl.DiskGetSystemVolume = i386DiskGetSystemVolume; + MachVtbl.DiskGetBootPath = i386DiskGetBootPath; + MachVtbl.DiskGetBootDevice = i386DiskGetBootDevice; + MachVtbl.DiskBootingFromFloppy = i386DiskBootingFromFloppy; MachVtbl.DiskReadLogicalSectors = PcDiskReadLogicalSectors; MachVtbl.DiskGetPartitionEntry = PcDiskGetPartitionEntry; MachVtbl.DiskGetDriveGeometry = PcDiskGetDriveGeometry; _____ Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/machxbox.c --- trunk/reactos/boot/freeldr/freeldr/arch/i386/machxbox.c 2005-04-19 06:26:01 UTC (rev 14697) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/machxbox.c 2005-04-19 08:51:16 UTC (rev 14698) @@ -21,6 +21,7 @@ #include "mm.h" #include "machine.h" #include "machxbox.h" +#include "i386.h" VOID XboxMachInit(VOID) @@ -46,6 +47,11 @@ MachVtbl.VideoSync = XboxVideoSync; MachVtbl.VideoPrepareForReactOS = XboxVideoPrepareForReactOS; MachVtbl.GetMemoryMap = XboxMemGetMemoryMap; + MachVtbl.DiskGetBootVolume = i386DiskGetBootVolume; + MachVtbl.DiskGetSystemVolume = i386DiskGetSystemVolume; + MachVtbl.DiskGetBootPath = i386DiskGetBootPath; + MachVtbl.DiskGetBootDevice = i386DiskGetBootDevice; + MachVtbl.DiskBootingFromFloppy = i386DiskBootingFromFloppy; MachVtbl.DiskReadLogicalSectors = XboxDiskReadLogicalSectors; MachVtbl.DiskGetPartitionEntry = XboxDiskGetPartitionEntry; MachVtbl.DiskGetDriveGeometry = XboxDiskGetDriveGeometry; _____ Modified: trunk/reactos/boot/freeldr/freeldr/bootmgr.c --- trunk/reactos/boot/freeldr/freeldr/bootmgr.c 2005-04-19 06:26:01 UTC (rev 14697) +++ trunk/reactos/boot/freeldr/freeldr/bootmgr.c 2005-04-19 08:51:16 UTC (rev 14698) @@ -49,6 +49,13 @@ LONG TimeOut; ULONG SelectedOperatingSystem; + if (!FsOpenBootVolume()) + { + printf("Error opening boot partition for file access.\n"); + MachConsGetCh(); + return; + } + if (!IniFileInitialize()) { printf("Press any key to reboot.\n"); _____ Modified: trunk/reactos/boot/freeldr/freeldr/disk/partition.c --- trunk/reactos/boot/freeldr/freeldr/disk/partition.c 2005-04-19 06:26:01 UTC (rev 14697) +++ trunk/reactos/boot/freeldr/freeldr/disk/partition.c 2005-04-19 08:51:16 UTC (rev 14698) @@ -28,7 +28,8 @@ BOOL DiskGetActivePartitionEntry(ULONG DriveNumber, PPARTITION_TABLE_ENTRY PartitionTableEntry) { - ULONG BootablePartitionCount = 0; + ULONG BootablePartitionCount = 0; + ULONG ActivePartition = 0; MASTER_BOOT_RECORD MasterBootRecord; // Read master boot record @@ -41,22 +42,22 @@ if (MasterBootRecord.PartitionTable[0].BootIndicator == 0x80) { BootablePartitionCount++; - BootPartition = 0; + ActivePartition = 0; } if (MasterBootRecord.PartitionTable[1].BootIndicator == 0x80) { BootablePartitionCount++; - BootPartition = 1; + ActivePartition = 1; } if (MasterBootRecord.PartitionTable[2].BootIndicator == 0x80) { BootablePartitionCount++; - BootPartition = 2; + ActivePartition = 2; } if (MasterBootRecord.PartitionTable[3].BootIndicator == 0x80) { BootablePartitionCount++; - BootPartition = 3; + ActivePartition = 3; } // Make sure there was only one bootable partition @@ -72,7 +73,7 @@ } // Copy the partition table entry - RtlCopyMemory(PartitionTableEntry, &MasterBootRecord.PartitionTable[BootPartition], sizeof(PARTITION_TABLE_ENTRY)); + RtlCopyMemory(PartitionTableEntry, &MasterBootRecord.PartitionTable[ActivePartition], sizeof(PARTITION_TABLE_ENTRY)); return TRUE; } _____ Modified: trunk/reactos/boot/freeldr/freeldr/fs/fs.c --- trunk/reactos/boot/freeldr/freeldr/fs/fs.c 2005-04-19 06:26:01 UTC (rev 14697) +++ trunk/reactos/boot/freeldr/freeldr/fs/fs.c 2005-04-19 08:51:16 UTC (rev 14698) @@ -51,110 +51,78 @@ /* * - * BOOL FsOpenVolume(ULONG DriveNumber, ULONG PartitionNumber); + * BOOL FsOpenVolume(ULONG DriveNumber, ULONGLONG StartSector, ULONGLONG SectorCount, int Type); * * This function is called to open a disk volume for file access. * It must be called before any of the file functions will work. - * It takes two parameters: * - * Drive: The BIOS drive number of the disk to open - * Partition: This is zero for floppy drives. - * If the disk is a hard disk then this specifies - * The partition number to open (1 - 4) - * If it is zero then it opens the active (bootable) partition - * */ -BOOL FsOpenVolume(ULONG DriveNumber, ULONG PartitionNumber) +static BOOL FsOpenVolume(ULONG DriveNumber, ULONGLONG StartSector, ULONGLONG SectorCount, int Type) { - PARTITION_TABLE_ENTRY PartitionTableEntry; - UCHAR ErrorText[80]; - UCHAR VolumeType; + UCHAR ErrorText[80]; - DbgPrint((DPRINT_FILESYSTEM, "FsOpenVolume() DriveNumber: 0x%x PartitionNumber: 0x%x\n", DriveNumber, PartitionNumber)); + FsType = Type; - // Check and see if it is a floppy drive - // If so then just assume FAT12 file system type - if (DiskIsDriveRemovable(DriveNumber)) + switch (FsType) { - DbgPrint((DPRINT_FILESYSTEM, "Drive is a floppy diskette drive. Assuming FAT12 file system.\n")); - - FsType = FS_FAT; - return FatOpenVolume(DriveNumber, 0, 0); - } - - // Check for ISO9660 file system type - if (DriveNumber >= 0x80 && FsRecIsIso9660(DriveNumber)) - { - DbgPrint((DPRINT_FILESYSTEM, "Drive is a cdrom drive. Assuming ISO-9660 file system.\n")); - - FsType = FS_ISO9660; + case FS_FAT: + return FatOpenVolume(DriveNumber, StartSector, SectorCount); + case FS_EXT2: + return Ext2OpenVolume(DriveNumber, StartSector); + case FS_NTFS: + return NtfsOpenVolume(DriveNumber, StartSector); + case FS_ISO9660: return IsoOpenVolume(DriveNumber); + default: + FsType = 0; + sprintf(ErrorText, "Unsupported file system. Type: 0x%x", Type); + FileSystemError(ErrorText); } - // Set the boot partition - BootPartition = PartitionNumber; + return FALSE; +} +/* + * + * BOOL FsOpenBootVolume() + * + * This function is called to open the boot disk volume for file access. + * It must be called before any of the file functions will work. + */ +BOOL FsOpenBootVolume() +{ + ULONG DriveNumber; + ULONGLONG StartSector; + ULONGLONG SectorCount; + int Type; - // Get the requested partition entry - if (PartitionNumber == 0) + if (! MachDiskGetBootVolume(&DriveNumber, &StartSector, &SectorCount, &Type)) { - // Partition requested was zero which means the boot partition - if (DiskGetActivePartitionEntry(DriveNumber, &PartitionTableEntry) == FALSE) - { - FileSystemError("No active partition."); - return FALSE; - } - } - else - { - // Get requested partition - if (MachDiskGetPartitionEntry(DriveNumber, PartitionNumber, &PartitionTableEntry) == FALSE) - { - FileSystemError("Partition not found."); - return FALSE; - } - } - - // Check for valid partition - if (PartitionTableEntry.SystemIndicator == PARTITION_ENTRY_UNUSED) - { - FileSystemError("Invalid partition."); + FileSystemError("Unable to locate boot partition\n"); return FALSE; } - // Try to recognize the file system - if (!FsRecognizeVolume(DriveNumber, PartitionTableEntry.SectorCountBeforePartition, &VolumeType)) - { - FileSystemError("Unrecognized file system."); - return FALSE; - } + return FsOpenVolume(DriveNumber, StartSector, SectorCount, Type); +} - //switch (PartitionTableEntry.SystemIndicator) - switch (VolumeType) +BOOL FsOpenSystemVolume(char *SystemPath, char *RemainingPath, PULONG Device) +{ + ULONG DriveNumber; + ULONGLONG StartSector; + ULONGLONG SectorCount; + int Type; + + if (! MachDiskGetSystemVolume(SystemPath, RemainingPath, Device, + &DriveNumber, &StartSector, &SectorCount, + &Type)) { - case PARTITION_FAT_12: - case PARTITION_FAT_16: - case PARTITION_HUGE: - case PARTITION_XINT13: - case PARTITION_FAT32: - case PARTITION_FAT32_XINT13: - FsType = FS_FAT; - return FatOpenVolume(DriveNumber, PartitionTableEntry.SectorCountBeforePartition, PartitionTableEntry.PartitionSectorCount); - case PARTITION_EXT2: - FsType = FS_EXT2; - return Ext2OpenVolume(DriveNumber, PartitionTableEntry.SectorCountBeforePartition); - case PARTITION_NTFS: - FsType = FS_NTFS; - return NtfsOpenVolume(DriveNumber, PartitionTableEntry.SectorCountBeforePartition); - default: - FsType = 0; - sprintf(ErrorText, "Unsupported file system. Type: 0x%x", VolumeType); - FileSystemError(ErrorText); + FileSystemError("Unable to locate system partition\n"); return FALSE; } - return TRUE; + return FsOpenVolume(DriveNumber, StartSector, SectorCount, Type); } + PFILE FsOpenFile(PUCHAR FileName) { PFILE FileHandle = NULL; _____ Deleted: trunk/reactos/boot/freeldr/freeldr/fs/fsrec.h --- trunk/reactos/boot/freeldr/freeldr/fs/fsrec.h 2005-04-19 06:26:01 UTC (rev 14697) +++ trunk/reactos/boot/freeldr/freeldr/fs/fsrec.h 2005-04-19 08:51:16 UTC (rev 14698) @@ -1,29 +0,0 @@ -/* - * FreeLoader - * Copyright (C) 1998-2003 Brian Palmer <brianp(a)sginet.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef __FSREC_H -#define __FSREC_H - -BOOL FsRecognizeVolume(ULONG DriveNumber, ULONG VolumeStartSector, UCHAR* VolumeType); -BOOL FsRecIsIso9660(ULONG DriveNumber); -BOOL FsRecIsExt2(ULONG DriveNumber, ULONG VolumeStartSector); -BOOL FsRecIsFat(ULONG DriveNumber, ULONG VolumeStartSector); -BOOL FsRecIsNtfs(ULONG DriveNumber, ULONG VolumeStartSector); - -#endif // #defined __FSREC_H _____ Modified: trunk/reactos/boot/freeldr/freeldr/include/freeldr.h --- trunk/reactos/boot/freeldr/freeldr/include/freeldr.h 2005-04-19 06:26:01 UTC (rev 14697) +++ trunk/reactos/boot/freeldr/freeldr/include/freeldr.h 2005-04-19 08:51:16 UTC (rev 14698) @@ -38,8 +38,6 @@ #define ROUND_DOWN(N, S) ((N) & ~((S) - 1)) #define Ke386EraseFlags(x) __asm__ __volatile__("pushl $0 ; popfl\n") -extern ULONG BootDrive; /* BIOS boot drive, 0-A:, 1-B:, 0x80-C:, 0x81-D:, etc. */ -extern ULONG BootPartition; /* Boot Partition, 1-4 */ extern BOOL UserInterfaceUp; /* Tells us if the user interface is displayed */ VOID BootMain(LPSTR CmdLine); _____ Modified: trunk/reactos/boot/freeldr/freeldr/include/fs.h --- trunk/reactos/boot/freeldr/freeldr/include/fs.h 2005-04-19 06:26:01 UTC (rev 14697) +++ trunk/reactos/boot/freeldr/freeldr/include/fs.h 2005-04-19 08:51:16 UTC (rev 14698) @@ -33,7 +33,8 @@ #define PFILE FILE * VOID FileSystemError(PUCHAR ErrorString); -BOOL FsOpenVolume(ULONG DriveNumber, ULONG PartitionNumber); +BOOL FsOpenBootVolume(); +BOOL FsOpenSystemVolume(char *SystemPath, char *RemainingPath, PULONG BootDevice); PFILE FsOpenFile(PUCHAR FileName); VOID FsCloseFile(PFILE FileHandle); BOOL FsReadFile(PFILE FileHandle, ULONG BytesToRead, ULONG* BytesRead, PVOID Buffer); _____ Copied: trunk/reactos/boot/freeldr/freeldr/include/fsrec.h (from rev 14682, trunk/reactos/boot/freeldr/freeldr/fs/fsrec.h) _____ Modified: trunk/reactos/boot/freeldr/freeldr/include/machine.h --- trunk/reactos/boot/freeldr/freeldr/include/machine.h 2005-04-19 06:26:01 UTC (rev 14697) +++ trunk/reactos/boot/freeldr/freeldr/include/machine.h 2005-04-19 08:51:16 UTC (rev 14698) @@ -56,6 +56,11 @@ ULONG (*GetMemoryMap)(PBIOS_MEMORY_MAP BiosMemoryMap, ULONG MaxMemoryMapSize); + BOOL (*DiskGetBootVolume)(PULONG DriveNumber, PULONGLONG StartSector, PULONGLONG SectorCount, int *FsType); + BOOL (*DiskGetSystemVolume)(char *SystemPath, char *RemainingPath, PULONG Device, PULONG DriveNumber, PULONGLONG StartSector, PULONGLONG SectorCount, int *FsType); + BOOL (*DiskGetBootPath)(char *BootPath, unsigned Size); + VOID (*DiskGetBootDevice)(PULONG BootDevice); + BOOL (*DiskBootingFromFloppy)(VOID); BOOL (*DiskReadLogicalSectors)(ULONG DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer); BOOL (*DiskGetPartitionEntry)(ULONG DriveNumber, ULONG PartitionNumber, PPARTITION_TABLE_ENTRY PartitionTableEntry); BOOL (*DiskGetDriveGeometry)(ULONG DriveNumber, PGEOMETRY DriveGeometry); @@ -87,6 +92,11 @@ #define MachVideoSync() MachVtbl.VideoSync() #define MachVideoPrepareForReactOS() MachVtbl.VideoPrepareForReactOS() #define MachGetMemoryMap(MMap, Size) MachVtbl.GetMemoryMap((MMap), (Size)) +#define MachDiskGetBootVolume(Drv, Start, Cnt, FsType) MachVtbl.DiskGetBootVolume((Drv), (Start), (Cnt), (FsType)) +#define MachDiskGetSystemVolume(SysPath, RemPath, Dev, Drv, Start, Cnt, FsType) MachVtbl.DiskGetSystemVolume((SysPath), (RemPath), (Dev), (Drv), (Start), (Cnt), (FsType)) +#define MachDiskGetBootPath(Path, Size) MachVtbl.DiskGetBootPath((Path), (Size)) +#define MachDiskGetBootDevice(BootDevice) MachVtbl.DiskGetBootDevice(BootDevice) +#define MachDiskBootingFromFloppy() MachVtbl.DiskBootingFromFloppy() #define MachDiskReadLogicalSectors(Drive, Start, Count, Buf) MachVtbl.DiskReadLogicalSectors((Drive), (Start), (Count), (Buf)) #define MachDiskGetPartitionEntry(Drive, Part, Entry) MachVtbl.DiskGetPartitionEntry((Drive), (Part), (Entry)) #define MachDiskGetDriveGeometry(Drive, Geom) MachVtbl.DiskGetDriveGeometry((Drive), (Geom)) _____ Modified: trunk/reactos/boot/freeldr/freeldr/inifile/ini.h --- trunk/reactos/boot/freeldr/freeldr/inifile/ini.h 2005-04-19 06:26:01 UTC (rev 14697) +++ trunk/reactos/boot/freeldr/freeldr/inifile/ini.h 2005-04-19 08:51:16 UTC (rev 14698) @@ -57,7 +57,7 @@ extern ULONG IniFileSectionCount; extern ULONG IniFileSettingCount; -PFILE IniOpenIniFile(UCHAR BootDriveNumber, UCHAR BootPartitionNumber); +PFILE IniOpenIniFile(); BOOL IniParseFile(PUCHAR IniFileData, ULONG IniFileSize); ULONG IniGetNextLineSize(PUCHAR IniFileData, ULONG IniFileSize, ULONG CurrentOffset); _____ Modified: trunk/reactos/boot/freeldr/freeldr/inifile/ini_init.c --- trunk/reactos/boot/freeldr/freeldr/inifile/ini_init.c 2005-04-19 06:26:01 UTC (rev 14697) +++ trunk/reactos/boot/freeldr/freeldr/inifile/ini_init.c 2005-04-19 08:51:16 UTC (rev 14698) @@ -33,23 +33,8 @@ BOOL Success; // Open freeldr.ini - // BootDrive & BootPartition are passed - // in from the boot sector code in the - // DL & DH registers. - Freeldr_Ini = IniOpenIniFile(BootDrive, BootPartition); + Freeldr_Ini = IniOpenIniFile(); - // If we couldn't open freeldr.ini on the partition - // they specified in the boot sector then try - // opening the active (boot) partition. - if ((Freeldr_Ini == NULL) && (BootPartition != 0)) - { - BootPartition = 0; - - Freeldr_Ini = IniOpenIniFile(BootDrive, BootPartition); - - return FALSE; - } - if (Freeldr_Ini == NULL) { printf("Error opening freeldr.ini or file not found.\n"); @@ -87,24 +72,10 @@ return Success; } -PFILE IniOpenIniFile(UCHAR BootDriveNumber, UCHAR BootPartitionNumber) +PFILE IniOpenIniFile() { PFILE IniFileHandle; // File handle for freeldr.ini - if (!FsOpenVolume(BootDriveNumber, BootPartitionNumber)) - { - if (BootPartitionNumber == 0) - { - printf("Error opening active (bootable) partition on boot drive 0x%x for file access.\n", BootDriveNumber); - } - else - { - printf("Error opening partition %d on boot drive 0x%x for file access.\n", BootPartitionNumber, BootDriveNumber); - } - - return NULL; - } - // Try to open freeldr.ini IniFileHandle = FsOpenFile("freeldr.ini"); _____ Modified: trunk/reactos/boot/freeldr/freeldr/linuxboot.c --- trunk/reactos/boot/freeldr/freeldr/linuxboot.c 2005-04-19 06:26:01 UTC (rev 14697) +++ trunk/reactos/boot/freeldr/freeldr/linuxboot.c 2005-04-19 08:51:16 UTC (rev 14698) @@ -40,18 +40,19 @@ PLINUX_BOOTSECTOR LinuxBootSector = NULL; PLINUX_SETUPSECTOR LinuxSetupSector = NULL; -ULONG SetupSectorSize = 0; -BOOL NewStyleLinuxKernel = FALSE; -ULONG LinuxKernelSize = 0; -ULONG LinuxInitrdSize = 0; -UCHAR LinuxKernelName[260]; -UCHAR LinuxInitrdName[260]; -BOOL LinuxHasInitrd = FALSE; -UCHAR LinuxCommandLine[260] = ""; -ULONG LinuxCommandLineSize = 0; -PVOID LinuxKernelLoadAddress = NULL; -PVOID LinuxInitrdLoadAddress = NULL; -UCHAR LinuxBootDescription[80]; +ULONG SetupSectorSize = 0; +BOOL NewStyleLinuxKernel = FALSE; +ULONG LinuxKernelSize = 0; +ULONG LinuxInitrdSize = 0; +UCHAR LinuxKernelName[260]; +UCHAR LinuxInitrdName[260]; +BOOL LinuxHasInitrd = FALSE; +UCHAR LinuxCommandLine[260] = ""; +ULONG LinuxCommandLineSize = 0; +PVOID LinuxKernelLoadAddress = NULL; +PVOID LinuxInitrdLoadAddress = NULL; +UCHAR LinuxBootDescription[80]; +UCHAR LinuxBootPath[260] = ""; VOID LoadAndBootLinux(PUCHAR OperatingSystemName, PUCHAR Description) { @@ -80,7 +81,7 @@ } // Open the boot volume - if (!FsOpenVolume(BootDrive, BootPartition)) + if (!FsOpenSystemVolume(LinuxBootPath, NULL, NULL)) { UiMessageBox("Failed to open boot drive."); goto LinuxBootFailed; @@ -226,8 +227,7 @@ BOOL LinuxParseIniSection(PUCHAR OperatingSystemName) { UCHAR SettingName[260]; - UCHAR SettingValue[260]; - ULONG SectionId; + ULONG SectionId; // Find all the message box settings and run them UiShowMessageBoxesInSection(OperatingSystemName); @@ -240,20 +240,12 @@ return FALSE; } - if (!IniReadSettingByName(SectionId, "BootDrive", SettingValue, 260)) + if (!IniReadSettingByName(SectionId, "BootPath", LinuxBootPath, 260)) { - UiMessageBox("Boot drive not specified for selected OS!"); + UiMessageBox("Boot path not specified for selected OS!"); return FALSE; } - BootDrive = DriveMapGetBiosDriveNumber(SettingValue); - - BootPartition = 0; - if (IniReadSettingByName(SectionId, "BootPartition", SettingValue, 260)) - { - BootPartition = atoi(SettingValue); - } - // Get the kernel name if (!IniReadSettingByName(SectionId, "Kernel", LinuxKernelName, 260)) { _____ Modified: trunk/reactos/boot/freeldr/freeldr/machine.c --- trunk/reactos/boot/freeldr/freeldr/machine.c 2005-04-19 06:26:01 UTC (rev 14697) +++ trunk/reactos/boot/freeldr/freeldr/machine.c 2005-04-19 08:51:16 UTC (rev 14698) @@ -37,6 +37,11 @@ #undef MachVideoSync #undef MachVideoPrepareForReactOS #undef MachGetMemoryMap +#undef MachDiskGetBootVolume +#undef MachDiskGetSystemVolume +#undef MachDiskGetBootPath +#undef MachDiskGetBootDevice +#undef MachDiskBootingFromFloppy #undef MachDiskReadLogicalSectors #undef MachDiskGetPartitionEntry #undef MachDiskGetDriveGeometry @@ -149,6 +154,44 @@ } BOOL +MachDiskGetBootVolume(PULONG DriveNumber, PULONGLONG StartSector, PULONGLONG SectorCount, int *FsType) +{ + return MachVtbl.DiskGetBootVolume(DriveNumber, StartSector, SectorCount, FsType); +} + +BOOL +MachDiskGetSystemVolume(char *SystemPath, + char *RemainingPath, + PULONG Device, + PULONG DriveNumber, + PULONGLONG StartSector, + PULONGLONG SectorCount, + int *FsType) +{ + return MachVtbl.DiskGetSystemVolume(SystemPath, RemainingPath, Device, + DriveNumber, StartSector, SectorCount, + FsType); +} + +BOOL +MachDiskGetBootPath(char *BootPath, unsigned Size) +{ + return MachVtbl.DiskGetBootPath(BootPath, Size); +} + +VOID +MachDiskGetBootDevice(PULONG BootDevice) +{ + MachVtbl.DiskGetBootDevice(BootDevice); +} + +BOOL +MachDiskBootingFromFloppy() +{ + return MachVtbl.DiskBootingFromFloppy(); +} + +BOOL MachDiskReadLogicalSectors(ULONG DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer) { return MachVtbl.DiskReadLogicalSectors(DriveNumber, SectorNumber, SectorCount, Buffer); _____ Modified: trunk/reactos/boot/freeldr/freeldr/miscboot.c --- trunk/reactos/boot/freeldr/freeldr/miscboot.c 2005-04-19 06:26:01 UTC (rev 14697) +++ trunk/reactos/boot/freeldr/freeldr/miscboot.c 2005-04-19 08:51:16 UTC (rev 14698) @@ -33,10 +33,9 @@ { PFILE FilePointer; UCHAR SettingName[80]; - UCHAR SettingValue[80]; - ULONG SectionId; + ULONG SectionId; UCHAR FileName[260]; - ULONG BytesRead; + ULONG BytesRead; // Find all the message box settings and run them UiShowMessageBoxesInSection(OperatingSystemName); @@ -49,27 +48,13 @@ return; } - if (!IniReadSettingByName(SectionId, "BootDrive", SettingValue, 80)) - { - UiMessageBox("Boot drive not specified for selected OS!"); - return; - } - - BootDrive = DriveMapGetBiosDriveNumber(SettingValue); - - BootPartition = 0; - if (IniReadSettingByName(SectionId, "BootPartition", SettingValue, 80)) - { - BootPartition = atoi(SettingValue); - } [truncated at 1000 lines; 341 more skipped]
19 years, 6 months
1
0
0
0
[ion] 14697: damn fingers were too fast. sorry, reverting
by ion@svn.reactos.com
damn fingers were too fast. sorry, reverting Modified: trunk/reactos/ntoskrnl/ps/idle.c Modified: trunk/reactos/ntoskrnl/ps/psmgr.c _____ Modified: trunk/reactos/ntoskrnl/ps/idle.c --- trunk/reactos/ntoskrnl/ps/idle.c 2005-04-19 06:24:15 UTC (rev 14696) +++ trunk/reactos/ntoskrnl/ps/idle.c 2005-04-19 06:26:01 UTC (rev 14697) @@ -19,7 +19,7 @@ extern PEPROCESS PsIdleProcess; /* FUNCTIONS *****************************************************************/ - + /** System idle thread procedure * */ @@ -45,82 +45,45 @@ } } -/* - * HACK-O-RAMA - * Antique vestigial code left alive for the sole purpose of First/Idle Thread - * creation until I can merge my fix for properly creating them. - */ -NTSTATUS -PsInitializeIdleOrFirstThread(PEPROCESS Process, - PETHREAD* ThreadPtr, - PKSTART_ROUTINE StartRoutine, - KPROCESSOR_MODE AccessMode, - BOOLEAN First) -{ - PETHREAD Thread; - PVOID KernelStack; - extern unsigned int init_stack; - PAGED_CODE(); - - Thread = ExAllocatePool(NonPagedPool, sizeof(ETHREAD)); - - RtlZeroMemory(Thread, sizeof(ETHREAD)); - Thread->ThreadsProcess = Process; - - DPRINT("Thread = %x\n",Thread); - - if (First) - { - KernelStack = (PVOID)init_stack; - } - else - { - KernelStack = MmCreateKernelStack(FALSE); - } - - KeInitializeThread(&Process->Pcb, - &Thread->Tcb, - PspSystemThreadStartup, - StartRoutine, - NULL, - NULL, - NULL, - KernelStack); - Thread->Tcb.ApcQueueable = TRUE; - - InitializeListHead(&Thread->IrpList); - - DPRINT("Thread->Cid.UniqueThread %d\n",Thread->Cid.UniqueThread); - - *ThreadPtr = Thread; - - return STATUS_SUCCESS; -} - -/* - * HACK-O-RAMA - * Antique vestigial code left alive for the sole purpose of First/Idle Thread - * creation until I can merge my fix for properly creating them. - */ -VOID -INIT_FUNCTION +/** Initialization of system idle thread + * + */ +VOID INIT_FUNCTION PsInitIdleThread(VOID) { - PETHREAD IdleThread; - KIRQL oldIrql; + NTSTATUS Status; + PETHREAD IdleThread; + KIRQL oldIrql; - PsInitializeIdleOrFirstThread(PsIdleProcess, - &IdleThread, - PsIdleThreadMain, - KernelMode, - FALSE); + Status = PsInitializeThread(PsIdleProcess, + &IdleThread, + NULL, + KernelMode, + FALSE); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Couldn't create idle system thread! Status: 0x%x\n", Status); + KEBUGCHECK(0); + return; + } + + IdleThread->StartAddress = PsIdleThreadMain; + Status = KiArchInitThread(&IdleThread->Tcb, PsIdleThreadMain, NULL); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Couldn't initialize system idle thread! Status: 0x%x\n", Status); + ObDereferenceObject(IdleThread); + KEBUGCHECK(0); + return; + } - oldIrql = KeAcquireDispatcherDatabaseLock (); - KiUnblockThread(&IdleThread->Tcb, NULL, 0); - KeReleaseDispatcherDatabaseLock(oldIrql); + oldIrql = KeAcquireDispatcherDatabaseLock (); + KiUnblockThread(&IdleThread->Tcb, NULL, 0); + KeReleaseDispatcherDatabaseLock(oldIrql); - KeGetCurrentPrcb()->IdleThread = &IdleThread->Tcb; - KeSetPriorityThread(&IdleThread->Tcb, LOW_PRIORITY); - KeSetAffinityThread(&IdleThread->Tcb, 1 << 0); + KeGetCurrentPrcb()->IdleThread = &IdleThread->Tcb; + KeSetPriorityThread(&IdleThread->Tcb, LOW_PRIORITY); + KeSetAffinityThread(&IdleThread->Tcb, 1 << 0); + } _____ Modified: trunk/reactos/ntoskrnl/ps/psmgr.c --- trunk/reactos/ntoskrnl/ps/psmgr.c 2005-04-19 06:24:15 UTC (rev 14696) +++ trunk/reactos/ntoskrnl/ps/psmgr.c 2005-04-19 06:26:01 UTC (rev 14697) @@ -103,7 +103,7 @@ ObpCreateTypeObject(PsThreadType); - PsInitializeIdleOrFirstThread(PsInitialSystemProcess, &FirstThread, NULL, KernelMode, TRUE); + PsInitializeThread(NULL, &FirstThread, NULL, KernelMode, TRUE); FirstThread->Tcb.State = Running; FirstThread->Tcb.FreezeCount = 0; FirstThread->Tcb.UserAffinity = (1 << 0); /* Set the affinity of the first thread to the boot processor */
19 years, 6 months
1
0
0
0
[ion] 14696: Use MmDeleteKernelStack and remove KeReleaseThread
by ion@svn.reactos.com
Use MmDeleteKernelStack and remove KeReleaseThread Modified: trunk/reactos/ntoskrnl/ps/idle.c Modified: trunk/reactos/ntoskrnl/ps/psmgr.c _____ Modified: trunk/reactos/ntoskrnl/ps/idle.c --- trunk/reactos/ntoskrnl/ps/idle.c 2005-04-19 06:22:36 UTC (rev 14695) +++ trunk/reactos/ntoskrnl/ps/idle.c 2005-04-19 06:24:15 UTC (rev 14696) @@ -19,7 +19,7 @@ extern PEPROCESS PsIdleProcess; /* FUNCTIONS *****************************************************************/ - + /** System idle thread procedure * */ @@ -45,45 +45,82 @@ } } +/* + * HACK-O-RAMA + * Antique vestigial code left alive for the sole purpose of First/Idle Thread + * creation until I can merge my fix for properly creating them. + */ +NTSTATUS +PsInitializeIdleOrFirstThread(PEPROCESS Process, + PETHREAD* ThreadPtr, + PKSTART_ROUTINE StartRoutine, + KPROCESSOR_MODE AccessMode, + BOOLEAN First) +{ + PETHREAD Thread; + PVOID KernelStack; + extern unsigned int init_stack; -/** Initialization of system idle thread - * - */ -VOID INIT_FUNCTION + PAGED_CODE(); + + Thread = ExAllocatePool(NonPagedPool, sizeof(ETHREAD)); + + RtlZeroMemory(Thread, sizeof(ETHREAD)); + Thread->ThreadsProcess = Process; + + DPRINT("Thread = %x\n",Thread); + + if (First) + { + KernelStack = (PVOID)init_stack; + } + else + { + KernelStack = MmCreateKernelStack(FALSE); + } + + KeInitializeThread(&Process->Pcb, + &Thread->Tcb, + PspSystemThreadStartup, + StartRoutine, + NULL, + NULL, + NULL, + KernelStack); + Thread->Tcb.ApcQueueable = TRUE; + + InitializeListHead(&Thread->IrpList); + + DPRINT("Thread->Cid.UniqueThread %d\n",Thread->Cid.UniqueThread); + + *ThreadPtr = Thread; + + return STATUS_SUCCESS; +} + +/* + * HACK-O-RAMA + * Antique vestigial code left alive for the sole purpose of First/Idle Thread + * creation until I can merge my fix for properly creating them. + */ +VOID +INIT_FUNCTION PsInitIdleThread(VOID) { - NTSTATUS Status; - PETHREAD IdleThread; - KIRQL oldIrql; + PETHREAD IdleThread; + KIRQL oldIrql; - Status = PsInitializeThread(PsIdleProcess, - &IdleThread, - NULL, - KernelMode, - FALSE); - if (!NT_SUCCESS(Status)) - { - DPRINT1("Couldn't create idle system thread! Status: 0x%x\n", Status); - KEBUGCHECK(0); - return; - } - - IdleThread->StartAddress = PsIdleThreadMain; - Status = KiArchInitThread(&IdleThread->Tcb, PsIdleThreadMain, NULL); - if (!NT_SUCCESS(Status)) - { - DPRINT1("Couldn't initialize system idle thread! Status: 0x%x\n", Status); - ObDereferenceObject(IdleThread); - KEBUGCHECK(0); - return; - } + PsInitializeIdleOrFirstThread(PsIdleProcess, + &IdleThread, + PsIdleThreadMain, + KernelMode, + FALSE); - oldIrql = KeAcquireDispatcherDatabaseLock (); - KiUnblockThread(&IdleThread->Tcb, NULL, 0); - KeReleaseDispatcherDatabaseLock(oldIrql); + oldIrql = KeAcquireDispatcherDatabaseLock (); + KiUnblockThread(&IdleThread->Tcb, NULL, 0); + KeReleaseDispatcherDatabaseLock(oldIrql); - KeGetCurrentPrcb()->IdleThread = &IdleThread->Tcb; - KeSetPriorityThread(&IdleThread->Tcb, LOW_PRIORITY); - KeSetAffinityThread(&IdleThread->Tcb, 1 << 0); - + KeGetCurrentPrcb()->IdleThread = &IdleThread->Tcb; + KeSetPriorityThread(&IdleThread->Tcb, LOW_PRIORITY); + KeSetAffinityThread(&IdleThread->Tcb, 1 << 0); } _____ Modified: trunk/reactos/ntoskrnl/ps/psmgr.c --- trunk/reactos/ntoskrnl/ps/psmgr.c 2005-04-19 06:22:36 UTC (rev 14695) +++ trunk/reactos/ntoskrnl/ps/psmgr.c 2005-04-19 06:24:15 UTC (rev 14696) @@ -103,7 +103,7 @@ ObpCreateTypeObject(PsThreadType); - PsInitializeThread(NULL, &FirstThread, NULL, KernelMode, TRUE); + PsInitializeIdleOrFirstThread(PsInitialSystemProcess, &FirstThread, NULL, KernelMode, TRUE); FirstThread->Tcb.State = Running; FirstThread->Tcb.FreezeCount = 0; FirstThread->Tcb.UserAffinity = (1 << 0); /* Set the affinity of the first thread to the boot processor */
19 years, 6 months
1
0
0
0
[ion] 14695: Use MmDeleteKernelStack and remove KeReleaseThread
by ion@svn.reactos.com
Use MmDeleteKernelStack and remove KeReleaseThread Modified: trunk/reactos/ntoskrnl/ke/kthread.c Modified: trunk/reactos/ntoskrnl/ps/kill.c _____ Modified: trunk/reactos/ntoskrnl/ke/kthread.c --- trunk/reactos/ntoskrnl/ke/kthread.c 2005-04-19 05:01:47 UTC (rev 14694) +++ trunk/reactos/ntoskrnl/ke/kthread.c 2005-04-19 06:22:36 UTC (rev 14695) @@ -917,48 +917,7 @@ return Thread->KernelTime; } -VOID -KeFreeStackPage(PVOID Context, - MEMORY_AREA* MemoryArea, - PVOID Address, - PFN_TYPE Page, - SWAPENTRY SwapEntry, - BOOLEAN Dirty) -{ - ASSERT(SwapEntry == 0); - if (Page) MmReleasePageMemoryConsumer(MC_NPPOOL, Page); -} - -NTSTATUS -KeReleaseThread(PKTHREAD Thread) /* - * FUNCTION: Releases the resource allocated for a thread by - * KeInitializeThread - * NOTE: The thread had better not be running when this is called - */ -{ - extern unsigned int init_stack; - - /* FIXME - lock the process */ - RemoveEntryList(&Thread->ThreadListEntry); - - if (Thread->StackLimit != (ULONG_PTR)init_stack) - { - MmLockAddressSpace(MmGetKernelAddressSpace()); - MmFreeMemoryAreaByPtr(MmGetKernelAddressSpace(), - (PVOID)Thread->StackLimit, - KeFreeStackPage, - NULL); - MmUnlockAddressSpace(MmGetKernelAddressSpace()); - } - Thread->StackLimit = 0; - Thread->InitialStack = NULL; - Thread->StackBase = NULL; - Thread->KernelStack = NULL; - return(STATUS_SUCCESS); -} - -/* * @implemented */ BOOLEAN _____ Modified: trunk/reactos/ntoskrnl/ps/kill.c --- trunk/reactos/ntoskrnl/ps/kill.c 2005-04-19 05:01:47 UTC (rev 14694) +++ trunk/reactos/ntoskrnl/ps/kill.c 2005-04-19 06:22:36 UTC (rev 14695) @@ -176,6 +176,7 @@ { PETHREAD Thread = (PETHREAD)ObjectBody; PEPROCESS Process = Thread->ThreadsProcess; + extern unsigned int init_stack; DPRINT("PiDeleteThread(ObjectBody 0x%x, process 0x%x)\n",ObjectBody, Thread->ThreadsProcess); @@ -191,8 +192,9 @@ /* Free the W32THREAD structure if present */ if(Thread->Tcb.Win32Thread != NULL) ExFreePool (Thread->Tcb.Win32Thread); - /* Release the Thread */ - KeReleaseThread(ETHREAD_TO_KTHREAD(Thread)); + /* Release the Kernel Stack */ + if (Thread->Tcb.StackLimit != (ULONG_PTR)init_stack) + MmDeleteKernelStack((PVOID)Thread->Tcb.StackLimit, FALSE); /* Dereference the Process */ ObDereferenceObject(Process);
19 years, 6 months
1
0
0
0
← Newer
1
...
16
17
18
19
20
21
22
...
48
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
Results per page:
10
25
50
100
200