110 WSADATA wsadata;
111
112 switch (reason) {
113 case DLL_PROCESS_ATTACH:
114 if (WSAStartup(MAKEWORD(2,2), &wsadata) != 0) {
115 return FALSE;
116 }
117 break;
118
119 case DLL_PROCESS_DETACH:
120 WSACleanup();
121 break;
122
123 default:
124 break;
125 }
126 return TRUE;
127 }
128
129 void platformInit() {}
130 void parseExclusiveBindProperty(JNIEnv *env) {}
131
132 /*
133 * Since winsock doesn't have the equivalent of strerror(errno)
134 * use table to lookup error text for the error.
135 */
136 JNIEXPORT void JNICALL
137 NET_ThrowNew(JNIEnv *env, int errorNum, char *msg)
138 {
139 int i;
140 int table_size = sizeof(winsock_errors) /
141 sizeof(winsock_errors[0]);
142 char exc[256];
143 char fullMsg[256];
144 char *excP = NULL;
145
146 /*
147 * If exception already throw then don't overwrite it.
148 */
149 if ((*env)->ExceptionOccurred(env)) {
150 return;
|
110 WSADATA wsadata;
111
112 switch (reason) {
113 case DLL_PROCESS_ATTACH:
114 if (WSAStartup(MAKEWORD(2,2), &wsadata) != 0) {
115 return FALSE;
116 }
117 break;
118
119 case DLL_PROCESS_DETACH:
120 WSACleanup();
121 break;
122
123 default:
124 break;
125 }
126 return TRUE;
127 }
128
129 void platformInit() {}
130
131 /*
132 * Since winsock doesn't have the equivalent of strerror(errno)
133 * use table to lookup error text for the error.
134 */
135 JNIEXPORT void JNICALL
136 NET_ThrowNew(JNIEnv *env, int errorNum, char *msg)
137 {
138 int i;
139 int table_size = sizeof(winsock_errors) /
140 sizeof(winsock_errors[0]);
141 char exc[256];
142 char fullMsg[256];
143 char *excP = NULL;
144
145 /*
146 * If exception already throw then don't overwrite it.
147 */
148 if ((*env)->ExceptionOccurred(env)) {
149 return;
|